Set errno to 0 before calling strtol.
This commit is contained in:
parent
b508aeb994
commit
bb48c5fa67
@ -74,6 +74,7 @@ void loadServerConfig(char *filename) {
|
||||
} else if (!strcasecmp(argv[0],"unixsocket") && argc == 2) {
|
||||
server.unixsocket = zstrdup(argv[1]);
|
||||
} else if (!strcasecmp(argv[0],"unixsocketperm") && argc == 2) {
|
||||
errno = 0;
|
||||
server.unixsocketperm = (mode_t)strtol(argv[1], NULL, 8);
|
||||
if (errno || server.unixsocketperm > 0777) {
|
||||
err = "Invalid socket file permissions"; goto loaderr;
|
||||
|
Loading…
Reference in New Issue
Block a user