chiark / gitweb /
shared: util - use nicer idiom to silence Coverity
authorTom Gundersen <teg@jklm.no>
Tue, 30 Sep 2014 09:37:28 +0000 (11:37 +0200)
committerTom Gundersen <teg@jklm.no>
Tue, 30 Sep 2014 09:37:28 +0000 (11:37 +0200)
Suggested by Zbigniew.

src/shared/util.c

index ec33fc126321bc011ca360df73acc77cb9de8357..ebacee55b181c379fa9fd0fb31cf269d9d9609b0 100644 (file)
@@ -3272,13 +3272,8 @@ unsigned columns(void) {
 
         c = 0;
         e = getenv("COLUMNS");
-        if (e) {
-                int r;
-
-                r = safe_atoi(e, &c);
-                if (r < 0) {}
-                        /* do nothing, we fall back to c = 0 */
-        }
+        if (e)
+                (void) safe_atoi(e, &c);
 
         if (c <= 0)
                 c = fd_columns(STDOUT_FILENO);