Fix all warnings in source3 with gcc4.3.
[ira/wip.git] / source3 / utils / net_cache.c
index 4e9ae18c0d9a6f8a738871aba547fdcf7a093e93..cabb6d5280845d3ada791ae1a6912caa39f00e26 100644 (file)
@@ -64,9 +64,8 @@ static void print_cache_entry(const char* keystr, const char* datastr,
                }
                timeout_str[strlen(timeout_str) - 1] = '\0';    /* remove tailing CR */
        } else {
-               asprintf(&alloc_str, "%.2d:%.2d:%.2d", timeout_tm.tm_hour,
-                        timeout_tm.tm_min, timeout_tm.tm_sec);
-               if (!alloc_str) {
+               if (asprintf(&alloc_str, "%.2d:%.2d:%.2d", timeout_tm.tm_hour,
+                        timeout_tm.tm_min, timeout_tm.tm_sec) == -1) {
                        return;
                }
                timeout_str = alloc_str;