diff -r 7f45d0401e37 -r 6d9713bfc346 util.c --- a/util.c Sat Apr 05 01:15:04 2008 -0400 +++ b/util.c Sun Jun 15 10:50:16 2008 -0400 @@ -15,9 +15,9 @@ const char *slash, *next; struct stat buf; - /* Create all sub-directories in dir and then create name. We - * know root exists and is a dir, root does not end in a '/', - * and path has a leading '/'. */ + /* Create all sub-directories in dir. We know root exists and + * is a dir, root does not end in a '/', and path has a + * leading '/'. */ strcpy(buffer, root); p = buffer + strlen(buffer); @@ -25,7 +25,7 @@ for (slash = path; *slash != '\0'; slash = next) { next = strchr(slash + 1, '/'); if (next == NULL) - next = slash + strlen(slash); + break; memcpy(p, slash, next - slash); p += next - slash;