aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-06-10 20:13:33 +0200
committerRickard Green <[email protected]>2015-06-10 20:13:33 +0200
commite6fce01ceb4e9ad27aade58f69857a5d9eb0d734 (patch)
treec969e7024f2cf60d403aa128e9a77f49d66f8854 /erts/emulator
parentfe1c0d26d4e6180b79fc8497b827ac2ef1f471d5 (diff)
downloadotp-e6fce01ceb4e9ad27aade58f69857a5d9eb0d734.tar.gz
otp-e6fce01ceb4e9ad27aade58f69857a5d9eb0d734.tar.bz2
otp-e6fce01ceb4e9ad27aade58f69857a5d9eb0d734.zip
Fix error checking for +zdntgc flag
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_init.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index a2d2a3befc..574a49dc7a 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -2030,10 +2030,12 @@ erl_start(int argc, char **argv)
if (sys_strcmp(arg, "infinity") == 0)
secs = ERTS_NODE_TAB_DELAY_GC_INFINITY;
else {
+ char *endptr;
errno = 0;
- secs = strtol(arg, NULL, 10);
- if (errno != 0 || secs < 0 || ERTS_NODE_TAB_DELAY_GC_MAX < secs) {
- erts_fprintf(stderr, "Invalid delayed node table gc: %ld\n", secs);
+ secs = strtol(arg, &endptr, 10);
+ if (errno != 0 || *arg == '\0' || *endptr != '\0'
+ || secs < 0 || ERTS_NODE_TAB_DELAY_GC_MAX < secs) {
+ erts_fprintf(stderr, "Invalid delayed node table gc: %s\n", arg);
erts_usage();
}
}