diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 99eff2b5b..16bc9e644 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,8 @@ +2004-09-02 Roland Illig + + * mcfs.c (mcfs_readlink): Fixed syntax error (usage of + undeclared variable). Simplified string copying. + 2004-09-02 Pavel S. Shirshov * extfs/uzip.in (mczipfs_list): Add support for negative diff --git a/vfs/mcfs.c b/vfs/mcfs.c index acd53ade7..7cb303975 100644 --- a/vfs/mcfs.c +++ b/vfs/mcfs.c @@ -966,8 +966,7 @@ static int mcfs_readlink (struct vfs_class *me, const char *path, char *buf, int size) { char *remote_file, *stat_str; - int error; - size_t len; + int status, error; mcfs_connection *mc; if (!(remote_file = mcfs_get_path (&mc, path))) @@ -985,9 +984,8 @@ mcfs_readlink (struct vfs_class *me, const char *path, char *buf, int size) if (!rpc_get (mc->sock, RPC_STRING, &stat_str, RPC_END)) return mcfs_set_error (-1, EIO); - len = strlen (stat_str); - size = len > (size - 1) ? size - 1 : len; - g_strlcpy (buf, stat_str, size + 1); + strncpy (buf, stat_str, size - 1); + buf[size - 1] = '\0'; g_free (stat_str); return size; }