Diff between 88f8bd2718d4941c67fbc0c7b7c8ab5750d9085d and 4a779362b78bd7b62f728a5a13d48e76a3536692

Changed Files

File Additions Deletions Status
obexd/src/ftp.c +2 -2 modified

Full Patch

diff --git a/obexd/src/ftp.c b/obexd/src/ftp.c
index 413f1c4..4797df5 100644
--- a/obexd/src/ftp.c
+++ b/obexd/src/ftp.c
@@ -76,7 +76,7 @@ static gchar *file_stat_line(gchar *filename, struct stat *fstat,
 				struct stat *dstat)
 {
 	gchar perm[51], atime[18], ctime[18], mtime[18];
-	gchar *escaped, *ret;
+	gchar *escaped, *ret = NULL;
 
 	snprintf(perm, 50, "user-perm=\"%s%s%s\" group-perm=\"%s%s%s\" "
 			"other-perm=\"%s%s%s\"",
@@ -99,7 +99,7 @@ static gchar *file_stat_line(gchar *filename, struct stat *fstat,
 	if (S_ISDIR(fstat->st_mode))
 		ret = g_strdup_printf(FL_FOLDER_ELEMENT, escaped,
 					perm, atime, mtime, ctime);
-	else
+	else if (S_ISREG(fstat->st_mode))
 		ret = g_strdup_printf(FL_FILE_ELEMENT, escaped, fstat->st_size,
 					perm, atime, mtime, ctime);