Code

store: Fixed data format error detection.
authorSebastian Harl <sh@tokkee.org>
Fri, 21 Feb 2014 01:46:33 +0000 (02:46 +0100)
committerSebastian Harl <sh@tokkee.org>
Fri, 21 Feb 2014 01:46:33 +0000 (02:46 +0100)
src/core/store_lookup.c

index 64145ee723de2bf39adb91830f541d2b17e22c53..089b99fb125756a0712506f8de9fbe34bc7edab4 100644 (file)
@@ -148,7 +148,7 @@ match_attr(attr_matcher_t *m, sdb_store_base_t *obj)
                sdb_attribute_t *attr = SDB_ATTR(obj);
                char buf[sdb_data_strlen(&attr->value) + 1];
 
-               if (sdb_data_format(&attr->value, buf, sizeof(buf), SDB_UNQUOTED))
+               if (sdb_data_format(&attr->value, buf, sizeof(buf), SDB_UNQUOTED) <= 0)
                        return -1;
                return match_name(&m->value, buf);
        }