Fixed bug in verify_document_root()

This commit is contained in:
valenok committed 2011-02-15 16:40:52 +00:00
1 parent 3583e83a3f
commit 27ccf416c1
1 file changed
+3 -2
+3 -2
View File
@@ -131,12 +131,13 @@ static void verify_document_root(const char *root) {
path = root; path = root;
if ((p = strchr(root, ',')) != NULL && (size_t) (p - root) < sizeof(buf)) { if ((p = strchr(root, ',')) != NULL && (size_t) (p - root) < sizeof(buf)) {
strncpy(buf, root, p - root); memcpy(buf, root, p - root);
buf[p - root] = '\0';
path = buf; path = buf;
} }
if (stat(path, &st) != 0 || !S_ISDIR(st.st_mode)) { if (stat(path, &st) != 0 || !S_ISDIR(st.st_mode)) {
die("Invalid root directory: \"%s\"", root); die("Invalid root directory: [%s]: %s", root, strerror(errno));
} }
} }