[systemd-commits] src/shared

Tom Gundersen tomegun at kemper.freedesktop.org
Tue Sep 30 02:41:50 PDT 2014


 src/shared/util.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit c6828d2794fcd00b6b0d2a040301c90ad424d14f
Author: Tom Gundersen <teg at jklm.no>
Date:   Tue Sep 30 11:37:28 2014 +0200

    shared: util - use nicer idiom to silence Coverity
    
    Suggested by Zbigniew.

diff --git a/src/shared/util.c b/src/shared/util.c
index ec33fc1..ebacee5 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -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);



More information about the systemd-commits mailing list