{
while (*str) {
unsigned char c = *str;
- if ((c == '\r') || (c == '\n') ||
- ((c < 32) && (c != '\t')))
+
+ if (c < 32 && c != '\t' && c != '\n' && c != '\r')
return false;
+
str++;
}
return true;
}
-__private void uci_parse_error(struct uci_context *ctx, char *pos, char *reason)
+__private void uci_parse_error(struct uci_context *ctx, char *reason)
{
struct uci_parse_context *pctx = ctx->pctx;
pctx->reason = reason;
- pctx->byte = pos - pctx->buf;
+ pctx->byte = pctx_pos(pctx);
UCI_THROW(ctx, UCI_ERR_PARSE);
}