mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
* 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:
parent
0fea1df332
commit
a2511b792c
@ -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>
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user