static int valid_structured_data_param(const char *str)
{
- char *s;
- char *eq = strchr(str, '='),
- *qm1 = strchr(str, '"'),
- *qm2 = qm1 ? ul_strchr_escaped(qm1 + 1, '"') : NULL;
+ const char *s;
+ const char *eq = strchr(str, '='),
+ *qm1 = strchr(str, '"'),
+ *qm2 = qm1 ? ul_strchr_escaped(qm1 + 1, '"') : NULL;
/* something is missing */
if (!eq || !qm1 || !qm2)
/* ']' need to be escaped */
for (s = qm1 + 1; s && *s; ) {
- char *p = strchr(s, ']');
+ const char *p = strchr(s, ']');
if (!p)
break;
if (p > qm2 || p == ul_strchr_escaped(s, ']'))
/* '\' is allowed only before '[]"\' chars */
for (s = qm1 + 1; s && *s; ) {
- char *p = strchr(s, '\\');
+ const char *p = strchr(s, '\\');
if (!p)
break;
if (!strchr("[]\"\\", *(p + 1)))
*/
static int valid_structured_data_id(const char *str)
{
- char *at = strchr(str, '@');
+ const char *at = strchr(str, '@');
const char *p;
/* standardized IDs without @<digits> */