1
1
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:
Tom Gundersen 2014-09-30 11:37:28 +02:00
parent e63ff941ea
commit c6828d2794

View File

@ -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);