diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-12 18:05:27 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-12 18:05:27 +0200 |
commit | d351a2403c5946d07ae6e6b6e075ff9896c6bcb6 (patch) | |
tree | 0390de88edfbc9aedc4f4f7f1d54a783398d9218 /src/options.c | |
parent | 02c3f0d648a00032b4cfc8d3f558d08c3fb2d5d9 (diff) | |
download | fastd-d351a2403c5946d07ae6e6b6e075ff9896c6bcb6.tar fastd-d351a2403c5946d07ae6e6b6e075ff9896c6bcb6.zip |
Improve integer checks
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/options.c b/src/options.c index aba6bd6..7bab8bc 100644 --- a/src/options.c +++ b/src/options.c @@ -151,7 +151,7 @@ static void option_mtu(fastd_context_t *ctx, fastd_config_t *conf, const char *a char *endptr; conf->mtu = strtol(arg, &endptr, 10); - if (*endptr || conf->mtu < 576) + if (*endptr || conf->mtu < 576 || conf->mtu > 65535) exit_error(ctx, "invalid mtu `%s'", arg); } @@ -185,7 +185,7 @@ static void option_bind(fastd_context_t *ctx, fastd_config_t *conf, const char * if (charptr) { l = strtol(charptr+1, &endptr, 10); - if (*endptr || l < 0 || l > 65535) + if (*endptr || l < 1 || l > 65535) exit_error(ctx, "invalid bind port `%s'", charptr+1); } else { |