mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
util: silence coverity
Make it clear in the code that ignoring a failed safe_ato?() is intentional.
This commit is contained in:
parent
e8c8ddccfc
commit
9fb02b1d5d
@ -3272,8 +3272,13 @@ unsigned columns(void) {
|
|||||||
|
|
||||||
c = 0;
|
c = 0;
|
||||||
e = getenv("COLUMNS");
|
e = getenv("COLUMNS");
|
||||||
if (e)
|
if (e) {
|
||||||
safe_atoi(e, &c);
|
int r;
|
||||||
|
|
||||||
|
r = safe_atoi(e, &c);
|
||||||
|
if (r < 0) {}
|
||||||
|
/* do nothing, we fall back to c = 0 */
|
||||||
|
}
|
||||||
|
|
||||||
if (c <= 0)
|
if (c <= 0)
|
||||||
c = fd_columns(STDOUT_FILENO);
|
c = fd_columns(STDOUT_FILENO);
|
||||||
@ -3306,8 +3311,13 @@ unsigned lines(void) {
|
|||||||
|
|
||||||
l = 0;
|
l = 0;
|
||||||
e = getenv("LINES");
|
e = getenv("LINES");
|
||||||
if (e)
|
if (e) {
|
||||||
safe_atou(e, &l);
|
int r;
|
||||||
|
|
||||||
|
r = safe_atou(e, &l);
|
||||||
|
if (r < 0) {}
|
||||||
|
/* do nothing, we fall back to l = 0 */
|
||||||
|
}
|
||||||
|
|
||||||
if (l <= 0)
|
if (l <= 0)
|
||||||
l = fd_lines(STDOUT_FILENO);
|
l = fd_lines(STDOUT_FILENO);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user