summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Duncan <leeman.duncan@gmail.com>2017-07-27 09:06:43 -0700
committerGitHub <noreply@github.com>2017-07-27 09:06:43 -0700
commit793dbad03fd7b241525d6d9a5a797e5445882b13 (patch)
tree61231a7e7b360c99f54e526ce5e81ef3c50c2fe9
parent8acf1fcc8d4d03ef64aee73ea16b5cf325878c97 (diff)
parent07fa8a7a4418d3a557cc02b204d4c0ced37911ad (diff)
downloadopen-iscsi-793dbad03fd7b241525d6d9a5a797e5445882b13.tar.gz
Merge pull request #60 from gonzoleeman/strtoull-fix
Strtoull fix
-rw-r--r--usr/iscsiadm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 6c27f3e..b30518a 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -3088,6 +3088,7 @@ static uint64_t parse_host_info(char *optarg, int *rc)
*rc = ISCSI_ERR_INVAL;
}
} else {
+ errno = 0; // ensure errors from strtoull are real
host_no = strtoull(optarg, NULL, 10);
if (errno || (host_no > MAX_HOST_NO)) {
if (host_no > MAX_HOST_NO)
@@ -3416,6 +3417,7 @@ main(int argc, char **argv)
ISCSI_VERSION_STR);
return 0;
case 'x':
+ errno = 0; // ensure errors from strtoull are real
index = strtoull(optarg, NULL, 10);
if (errno) {
log_error("Invalid index %s. %s.",