mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-24 02:03:54 +03:00
shared: util - use nicer idiom to silence Coverity
Suggested by Zbigniew.
This commit is contained in:
parent
e63ff941ea
commit
c6828d2794
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user