chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
terminal/screen: add color converter
[elogind.git]
/
src
/
shared
/
util.c
diff --git
a/src/shared/util.c
b/src/shared/util.c
index ec33fc126321bc011ca360df73acc77cb9de8357..bbd9bd11d6515205fd59d3d5f4120e6a099e335e 100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-3272,13
+3272,8
@@
unsigned columns(void) {
c = 0;
e = getenv("COLUMNS");
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);
if (c <= 0)
c = fd_columns(STDOUT_FILENO);
@@
-3311,13
+3306,8
@@
unsigned lines(void) {
l = 0;
e = getenv("LINES");
l = 0;
e = getenv("LINES");
- if (e) {
- int r;
-
- r = safe_atou(e, &l);
- if (r < 0) {}
- /* do nothing, we fall back to l = 0 */
- }
+ if (e)
+ (void) safe_atou(e, &l);
if (l <= 0)
l = fd_lines(STDOUT_FILENO);
if (l <= 0)
l = fd_lines(STDOUT_FILENO);