* dirent.c (split_dir_name): Don't assign a string literal to a

char *. Use '\0' instead of 0 when operating on characters.
This commit is contained in:
Roland Illig 2005-05-24 12:09:22 +00:00
parent 0fea1df332
commit a2511b792c
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,8 @@
2005-05-24 Roland Illig <roland.illig@gmx.de> 2005-05-24 Roland Illig <roland.illig@gmx.de>
* samba/param/loadparm.c: Fixed warnings reported by gcc-2.95. * samba/param/loadparm.c: Fixed warnings reported by gcc-2.95.
* dirent.c (split_dir_name): Don't assign a string literal to a
char *. Use '\0' instead of 0 when operating on characters.
2005-05-20 Pavel Roskin <proski@gnu.org> 2005-05-20 Pavel Roskin <proski@gnu.org>

View File

@ -301,14 +301,14 @@ split_dir_name (struct vfs_class *me, char *path, char **dir, char **name, char
(void) me; (void) me;
s = strrchr (path, PATH_SEP); s = strrchr (path, PATH_SEP);
if (!s){ if (s == NULL) {
*save = NULL; *save = NULL;
*name = path; *name = path;
*dir = ""; *dir = path + strlen(path); /* an empty string */
} else { } else {
*save = s; *save = s;
*dir = path; *dir = path;
*s++ = 0; *s++ = '\0';
*name = s; *name = s;
} }
} }