summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-29 14:30:15 +0200
committerTom Gundersen <teg@jklm.no>2014-09-29 20:52:10 +0200
commit9fb02b1d5df153aa522256aec821e422cca7f284 (patch)
treea57cbf310dc0b6b550237169792bc3f1d908d9a6
parente8c8ddccfc63574069c30b7e75f0ccfd5b03eab9 (diff)
util: silence coverity
Make it clear in the code that ignoring a failed safe_ato?() is intentional.
-rw-r--r--src/shared/util.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 30b0364b64..ec33fc1263 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3272,8 +3272,13 @@ unsigned columns(void) {
c = 0;
e = getenv("COLUMNS");
- if (e)
- safe_atoi(e, &c);
+ if (e) {
+ int r;
+
+ r = safe_atoi(e, &c);
+ if (r < 0) {}
+ /* do nothing, we fall back to c = 0 */
+ }
if (c <= 0)
c = fd_columns(STDOUT_FILENO);
@@ -3306,8 +3311,13 @@ unsigned lines(void) {
l = 0;
e = getenv("LINES");
- if (e)
- safe_atou(e, &l);
+ if (e) {
+ int r;
+
+ r = safe_atou(e, &l);
+ if (r < 0) {}
+ /* do nothing, we fall back to l = 0 */
+ }
if (l <= 0)
l = fd_lines(STDOUT_FILENO);