fix null string test
authorFelix Fietkau <nbd@openwrt.org>
Wed, 23 Jan 2008 00:08:19 +0000 (01:08 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 23 Jan 2008 00:08:19 +0000 (01:08 +0100)
file.c

diff --git a/file.c b/file.c
index 8428462..da72bde 100644 (file)
--- a/file.c
+++ b/file.c
@@ -45,7 +45,7 @@ static void uci_getln(struct uci_context *ctx, int offset)
                p[ofs] = 0;
 
                p = fgets(p, pctx->bufsz - ofs, pctx->file);
                p[ofs] = 0;
 
                p = fgets(p, pctx->bufsz - ofs, pctx->file);
-               if (!p || !p[ofs])
+               if (!p || !*p)
                        return;
 
                ofs += strlen(p);
                        return;
 
                ofs += strlen(p);