Diff between 6b00375df6aaa773a1e8aba3be220a7088d6cf81 and fa413ebabcd132a0102a6091eb9cd5efeaddb59c

Changed Files

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

Full Patch

diff --git a/obexd/src/ftp.c b/obexd/src/ftp.c
index da23847..54eff98 100644
--- a/obexd/src/ftp.c
+++ b/obexd/src/ftp.c
@@ -73,31 +73,32 @@
 			"modified=\"%s\" created=\"%s\"/>" EOL_CHARS
 
 
-static gchar *file_stat_line(gchar *filename, struct stat fstat, struct stat dstat)
+static gchar *file_stat_line(gchar *filename, struct stat *fstat,
+				struct stat *dstat)
 {
 	gchar perm[50], atime[17], ctime[17], mtime[17];
 
 	snprintf(perm, 49, "user-perm=\"%s%s%s\" group-perm=\"%s%s%s\" "
 			"other-perm=\"%s%s%s\"",
-			(fstat.st_mode & S_IRUSR ? "R" : ""),
-			(fstat.st_mode & S_IWUSR ? "W" : ""),
-			(dstat.st_mode & S_IWUSR ? "D" : ""),
-			(fstat.st_mode & S_IRGRP ? "R" : ""),
-			(fstat.st_mode & S_IWGRP ? "W" : ""),
-			(dstat.st_mode & S_IWGRP ? "D" : ""),
-			(fstat.st_mode & S_IROTH ? "R" : ""),
-			(fstat.st_mode & S_IWOTH ? "W" : ""),
-			(dstat.st_mode & S_IWOTH ? "D" : ""));
-
-	strftime(atime, 16, "%Y%m%dT%H%M%S", gmtime(&fstat.st_atime));
-	strftime(ctime, 16, "%Y%m%dT%H%M%S", gmtime(&fstat.st_ctime));
-	strftime(mtime, 16, "%Y%m%dT%H%M%S", gmtime(&fstat.st_mtime));
-
-	if (S_ISDIR(fstat.st_mode))
+			(fstat->st_mode & S_IRUSR ? "R" : ""),
+			(fstat->st_mode & S_IWUSR ? "W" : ""),
+			(dstat->st_mode & S_IWUSR ? "D" : ""),
+			(fstat->st_mode & S_IRGRP ? "R" : ""),
+			(fstat->st_mode & S_IWGRP ? "W" : ""),
+			(dstat->st_mode & S_IWGRP ? "D" : ""),
+			(fstat->st_mode & S_IROTH ? "R" : ""),
+			(fstat->st_mode & S_IWOTH ? "W" : ""),
+			(dstat->st_mode & S_IWOTH ? "D" : ""));
+
+	strftime(atime, 16, "%Y%m%dT%H%M%S", gmtime(&fstat->st_atime));
+	strftime(ctime, 16, "%Y%m%dT%H%M%S", gmtime(&fstat->st_ctime));
+	strftime(mtime, 16, "%Y%m%dT%H%M%S", gmtime(&fstat->st_mtime));
+
+	if (S_ISDIR(fstat->st_mode))
 		return g_strdup_printf(FL_FOLDER_ELEMENT, filename,
 					perm, atime, mtime, ctime);
 
-	return g_strdup_printf(FL_FILE_ELEMENT, filename, fstat.st_size,
+	return g_strdup_printf(FL_FILE_ELEMENT, filename, fstat->st_size,
 				perm, atime, mtime, ctime);
 }
 
@@ -145,7 +146,7 @@ static gboolean folder_listing(struct obex_session *os, guint32 *size)
 		}
 		g_free(fullname);
 
-		line = file_stat_line(name, fstat, dstat);
+		line = file_stat_line(name, &fstat, &dstat);
 		if (line == NULL) {
 			g_free(name);
 			continue;