From ce1c97bd7d94cf9eab2edeace377d30cf54d637d Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 20 Apr 2014 17:31:29 +0400 Subject: [PATCH] (ftpfs_dir_load): fix usage of unitialized variable. Signed-off-by: Andrew Borodin --- src/vfs/ftpfs/ftpfs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c index 4fe5379af..acd4b2cc1 100644 --- a/src/vfs/ftpfs/ftpfs.c +++ b/src/vfs/ftpfs/ftpfs.c @@ -1657,7 +1657,6 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path struct vfs_s_entry *ent; struct vfs_s_super *super = dir->super; int sock, num_entries = 0; - char lc_buffer[BUF_8K]; int cd_first; cd_first = ftpfs_first_cd_then_ls || (SUP->strict == RFC_STRICT) @@ -1705,13 +1704,15 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path tty_enable_interrupt_key (); vfs_parse_ls_lga_init (); - while (1) + while (TRUE) { int i; size_t count_spaces = 0; - int res = vfs_s_get_line_interruptible (me, lc_buffer, sizeof (lc_buffer), - sock); - if (!res) + int res; + char lc_buffer[BUF_8K] = "\0"; + + res = vfs_s_get_line_interruptible (me, lc_buffer, sizeof (lc_buffer), sock); + if (res == 0) break; if (res == EINTR)