summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-30 11:37:28 +0200
committerTom Gundersen <teg@jklm.no>2014-09-30 11:37:28 +0200
commitc6828d2794fcd00b6b0d2a040301c90ad424d14f (patch)
tree2f02a5e1b48c8ded83e9bb770b19ad61839c50af
parente63ff941eaa012ffd003e3791438c73b8a26227d (diff)
shared: util - use nicer idiom to silence Coverity
Suggested by Zbigniew.
-rw-r--r--src/shared/util.c9
1 files 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);