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/urls.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/urls.c')
| -rw-r--r-- | loader2/urls.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/loader2/urls.c b/loader2/urls.c index f95c75dcc..8dd81bc2a 100644 --- a/loader2/urls.c +++ b/loader2/urls.c @@ -180,6 +180,7 @@ int urlinstStartTransfer(struct iurlinfo * ui, char *path, if (portstr == NULL) { port = -1; } else { + errno = 0; port = strtol(portstr, NULL, 10); if ((errno == ERANGE && (port == LONG_MIN || port == LONG_MAX)) || |
