dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Blob Blame History Raw
From c6828d2794fcd00b6b0d2a040301c90ad424d14f Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Tue, 30 Sep 2014 11:37:28 +0200
Subject: [PATCH] shared: util - use nicer idiom to silence Coverity

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

diff --git a/src/shared/util.c b/src/shared/util.c
index ec33fc1263..ebacee55b1 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);