* fish.c (fish_get_reply): Use g_strlcpy instead
sequence strncpy(), name[len] = '\0' * vfs.c (mc_get_current_wd): Likewise.
Этот коммит содержится в:
родитель
83de09639c
Коммит
71ffc327b5
@ -1,3 +1,9 @@
|
||||
2004-09-01 Pavel S. Shirshov <pavelsh@mail.ru>
|
||||
|
||||
* fish.c (fish_get_reply): Use g_strlcpy instead
|
||||
sequence strncpy(), name[len] = '\0'
|
||||
* vfs.c (mc_get_current_wd): Likewise.
|
||||
|
||||
2004-08-31 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* utilvfs.c (vfs_parse_ls_lga): Use atoll()/atof() instead of atol()
|
||||
|
@ -104,12 +104,11 @@ static int fish_get_reply (struct vfs_class *me, int sock, char *string_buf, int
|
||||
*string_buf = 0;
|
||||
return 4;
|
||||
}
|
||||
|
||||
if (strncmp(answer, "### ", 4)) {
|
||||
was_garbage = 1;
|
||||
if (string_buf) {
|
||||
strncpy(string_buf, answer, string_len - 1);
|
||||
*(string_buf + string_len - 1) = 0;
|
||||
}
|
||||
if (string_buf)
|
||||
g_strlcpy(string_buf, answer, string_len);
|
||||
} else return fish_decode_reply(answer+4, was_garbage);
|
||||
}
|
||||
}
|
||||
|
@ -601,8 +601,7 @@ mc_get_current_wd (char *buffer, int size)
|
||||
{
|
||||
const char *cwd = _vfs_get_cwd ();
|
||||
|
||||
g_strlcpy (buffer, cwd, size - 1);
|
||||
buffer[size - 1] = 0;
|
||||
g_strlcpy (buffer, cwd, size);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user