summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-11-25 11:54:09 +0100
committerFelix Fietkau <nbd@openwrt.org>2014-11-25 11:54:09 +0100
commitb342283d2dda28083322e99ffae874ba92839c74 (patch)
tree03b0f3090a23e3f5250a23ed0e15a17524a9a1ce
parent471dcf63d6ed4689cfd56f2648e6d1b48f46f14c (diff)
downloaduci-b342283d2dda28083322e99ffae874ba92839c74.tar.gz
fix a few formatting issues
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--file.c14
-rw-r--r--util.c8
2 files changed, 10 insertions, 12 deletions
diff --git a/file.c b/file.c
index 8d4408d..ffa3afa 100644
--- a/file.c
+++ b/file.c
@@ -90,11 +90,11 @@ static bool parse_backslash(struct uci_context *ctx)
pctx->pos += 1;
/* undecoded backslash at the end of line, fetch the next line */
- if (!pctx_cur_char(pctx)
- || pctx_cur_char(pctx) == '\n'
- || (pctx_cur_char(pctx) == '\r' &&
- pctx_char(pctx, pctx_pos(pctx) + 1) == '\n' &&
- !pctx_char(pctx, pctx_pos(pctx) + 2))) {
+ if (!pctx_cur_char(pctx) ||
+ pctx_cur_char(pctx) == '\n' ||
+ (pctx_cur_char(pctx) == '\r' &&
+ pctx_char(pctx, pctx_pos(pctx) + 1) == '\n' &&
+ !pctx_char(pctx, pctx_pos(pctx) + 2))) {
uci_getln(ctx, pctx->pos);
return false;
}
@@ -179,9 +179,9 @@ static void parse_single_quote(struct uci_context *ctx, int *target)
case 0:
/* Multi-line str value */
uci_getln(ctx, pctx->pos);
- if (!pctx_cur_char(pctx)) {
+ if (!pctx_cur_char(pctx))
uci_parse_error(ctx, "EOF with unterminated \"");
- }
+
break;
default:
addc(ctx, target, &pctx->pos);
diff --git a/util.c b/util.c
index 09f1817..f16a378 100644
--- a/util.c
+++ b/util.c
@@ -89,12 +89,10 @@ bool uci_validate_text(const char *str)
{
while (*str) {
unsigned char c = *str;
- if (((c < 32) &&
- (c != '\t') &&
- (c != '\n') &&
- (c != '\r'))) {
+
+ if (c < 32 && c != '\t' && c != '\n' && c != '\r')
return false;
- }
+
str++;
}
return true;