Permalink
Browse files

Set errno to 0 before calling strtol.

  • Loading branch information...
1 parent b6fe152 commit 1126d5aa49a166fa9d17a3e800a47e1a1d17fbb9 @florean florean committed Oct 21, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/config.c
View
@@ -75,6 +75,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;

0 comments on commit 1126d5a

Please sign in to comment.