diff options
-rw-r--r-- | syslogd.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -180,7 +180,10 @@ static int chroot_setup(void) memcpy(buffer, SYSLOG_PATH, len + 1); - for (i = 0; i < len; ++i) { + for (i = 0; i <= len && buffer[i] == '/'; ++i) + ; + + for (; i <= len; ++i) { if (buffer[i] == '\0' || buffer[i] == '/') { buffer[i] = '\0'; |