eina: comparing unsigned integer with less than zero.
authorSubodh Kumar <s7158.kumar@samsung.com>
Fri, 13 Oct 2017 18:46:28 +0000 (11:46 -0700)
committerCedric Bail <cedric@osg.samsung.com>
Fri, 13 Oct 2017 18:46:32 +0000 (11:46 -0700)
Summary: Unsigned integer should not be compared less than zero.

Test Plan: NA

Reviewers: cedric

Subscribers: shilpasingh, jpeg

Differential Revision: https://phab.enlightenment.org/D5274

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
src/lib/eina/eina_share_common.c
src/lib/eina/eina_strbuf.c

index 6ad55b7..e7ba2a7 100644 (file)
@@ -740,7 +740,7 @@ eina_share_common_add_length(Eina_Share *share,
 
    eina_share_common_population_add(share, slen);
 
-   if (slen <= 0)
+   if (slen == 0)
       return NULL;
 
    hash = eina_hash_superfast(str, slen);
index f18408d..a76e441 100644 (file)
@@ -94,7 +94,7 @@ eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...)
    len = vasprintf(&str, fmt, args);
    va_end(args);
 
-   if (len <= 0 || !str)
+   if (len == 0 || !str)
       return EINA_FALSE;
 
    ret = eina_strbuf_append_length(buf, str, len);
@@ -111,7 +111,7 @@ eina_strbuf_append_vprintf(Eina_Strbuf *buf, const char *fmt, va_list args)
 
    len = vasprintf(&str, fmt, args);
 
-   if (len <= 0 || !str)
+   if (len == 0 || !str)
       return EINA_FALSE;
 
    ret = eina_strbuf_append_length(buf, str, len);
@@ -131,7 +131,7 @@ eina_strbuf_insert_printf(Eina_Strbuf *buf, const char *fmt, size_t pos, ...)
    len = vasprintf(&str, fmt, args);
    va_end(args);
 
-   if (len <= 0 || !str)
+   if (len == 0 || !str)
       return EINA_FALSE;
 
    ret = eina_strbuf_insert(buf, str, pos);
@@ -151,7 +151,7 @@ eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
 
    len = vasprintf(&str, fmt, args);
 
-   if (len <= 0 || !str)
+   if (len == 0 || !str)
       return EINA_FALSE;
 
    ret = eina_strbuf_insert(buf, str, pos);