diff options
| author | David Cantrell <dcantrell@redhat.com> | 2008-06-27 03:25:34 -1000 |
|---|---|---|
| committer | David Cantrell <dcantrell@redhat.com> | 2008-06-27 03:25:38 -1000 |
| commit | 83389b2effe828debfbbcbebf87dbfd2cc12e361 (patch) | |
| tree | aeaffe2d818605590ffce1be6e894f861496fdd5 /loader2/fwloader.c | |
| parent | adfa32b7ae12e10545c927f71655aaef950013a0 (diff) | |
Per strtol(3) man page, set errno=0 before call.
From the NOTES section of strtol(3):
"Since strtol() can legitimately return 0, LONG_MAX, or
LONG_MIN (LLONG_MAX or LLONG_MIN for strtoll()) on both
success and failure, the calling program should set errno
to 0 before the call, and then determine if an error
occurred by checking whether errno has a non-zero value
after the call."
Diffstat (limited to 'loader2/fwloader.c')
| -rw-r--r-- | loader2/fwloader.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/loader2/fwloader.c b/loader2/fwloader.c index 114ffa485..2c0412e5c 100644 --- a/loader2/fwloader.c +++ b/loader2/fwloader.c @@ -471,6 +471,7 @@ static void load_firmware(struct fw_loader *fwl, struct uevent *uevent) return; } + errno = 0; timeout_secs = strtol(timeout, NULL, 10); if ((errno == ERANGE && (timeout_secs == LONG_MIN || |
