Error if hash bound is less than 2

Bad things happen otherwise.
master
C. McEnroe 2021-02-25 22:36:06 -05:00
parent 761979d33e
commit 06fb025496
1 changed files with 1 additions and 0 deletions

1
chat.c
View File

@ -123,6 +123,7 @@ uint32_t hashBound = 75;
static void parseHash(char *str) {
hashInit = strtoul(str, &str, 0);
if (*str) hashBound = strtoul(&str[1], NULL, 0);
if (hashBound < 2) errx(EX_USAGE, "hash bound must be >= 2");
}
#ifdef __OpenBSD__