fix a few formatting issues
[project/uci.git] / util.c
diff --git a/util.c b/util.c
index ce7d849..f16a378 100644 (file)
--- a/util.c
+++ b/util.c
@@ -89,9 +89,10 @@ bool uci_validate_text(const char *str)
 {
        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;
@@ -161,12 +162,12 @@ error:
 }
 
 
-__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);
 }