Browse Source

use long instead of int for strtol, and don't allow queue size to be 0...

tags/ggatessh-v1.0.0
John-Mark Gurney 5 years ago
parent
commit
d580ef7d5c
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      ggated/ggated.c

+ 2
- 2
ggated/ggated.c View File

@@ -95,7 +95,7 @@ struct ggd_export {
SLIST_ENTRY(ggd_export) e_next;
};

static int niothreads = 20;
static long niothreads = 20;
static const char *exports_file = GGATED_EXPORT_FILE;
static int got_sighup = 0;

@@ -1050,7 +1050,7 @@ main(int argc, char *argv[])
break;
case 'q':
niothreads = strtol(optarg, NULL, 10);
if (niothreads < 0)
if (niothreads <= 0)
errx(EXIT_FAILURE, "Invalid queue size.");
break;
case 'R':


Loading…
Cancel
Save