genconf: properly check retval of confnode_strvalue_to_boolvalue()
[libcmdline.git] / src / genconf / confnode.c
index 4882c84..3af3cd3 100644 (file)
@@ -206,7 +206,7 @@ int confnode_dotconfig_write(const struct confnode *n, FILE *f)
        if (confnode_get_value(n, buf, sizeof(buf)) < 0)
                return -1;
        val = confnode_strvalue_to_boolvalue(n, buf);
-       if (val < 1)
+       if (val < 0)
                return -1;
 
        if (val == 0) {
@@ -338,7 +338,7 @@ int confnode_check_deps(const struct confnode *n, int verbose)
        if (n->flags & CONFNODE_F_NO_DEPS)
                return 1;
 
-       /* check that there is no diabled "if" or"menuconfig" above
+       /* check that there is no disabled "if" or "menuconfig" above
         * our node */
        for (pn = n->parent; pn; pn = pn->parent) {
                if (pn->flags & CONFNODE_F_IS_ROOT)
@@ -380,7 +380,7 @@ int confnode_check_deps(const struct confnode *n, int verbose)
 
 /* Get string value of a node, including dep check. Return -1 on
  * error. Return the boolean value of the node (0 or 1) on success: in
- * this case, and if buf is no NULL, buf is filled with the strvalue. */
+ * this case, and if buf is not NULL, buf is filled with the strvalue. */
 int confnode_get_value(const struct confnode *n, char *buf, unsigned buflen)
 {
        int dep, ret, strvalue_len;