Diff between 48b3276603492477d9a5d141a3debe07758ae709 and 78baef1dd60e176c052f769187bde7552233f673

Changed Files

File Additions Deletions Status
obexd/src/ftp.c +4 -4 modified
obexd/src/manager.c +1 -2 modified
obexd/src/obex.c +16 -18 modified
obexd/src/opp.c +1 -3 modified

Full Patch

diff --git a/obexd/src/ftp.c b/obexd/src/ftp.c
index fea782c..e730ece 100644
--- a/obexd/src/ftp.c
+++ b/obexd/src/ftp.c
@@ -128,6 +128,7 @@ static gboolean folder_listing(struct obex_session *os, guint32 *size)
 	}
 
 	dp = opendir(os->current_folder);
+
 	while (dp && (ep = readdir(dp))) {
 		gchar *name;
 		gchar *fullname;
@@ -158,11 +159,13 @@ static gboolean folder_listing(struct obex_session *os, guint32 *size)
 			g_free(name);
 			continue;
 		}
+
 		g_free(name);
 
 		listing = g_string_append(listing, line);
 		g_free(line);
 	}
+
 	closedir(dp);
 
 	listing = g_string_append(listing, FL_BODY_END);
@@ -182,9 +185,8 @@ static gboolean get_capability(struct obex_session *os, guint32 *size)
 	if (os->server->capability == NULL)
 		return FALSE;
 
-	if (os->server->capability[0] != '!') {
+	if (os->server->capability[0] != '!')
 		return os_prepare_get(os, os->server->capability, size);
-	}
 
 	ret = g_spawn_command_line_sync(os->server->capability + 1,
 					&buf, NULL, &exit, &gerr);
@@ -269,8 +271,6 @@ void ftp_get(obex_t *obex, obex_object_t *obj)
 
 fail:
 	OBEX_ObjectSetRsp(obj, OBEX_RSP_FORBIDDEN, OBEX_RSP_FORBIDDEN);
-
-	return;
 }
 
 static gint ftp_delete(struct obex_session *os)
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 3024d54..2c84680 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -559,9 +559,8 @@ int request_authorization(gint32 cid, int fd, const gchar *filename,
 	dbus_pending_call_cancel(call);
 	dbus_pending_call_unref(call);
 
-	if (!agent || !agent->new_name) {
+	if (!agent || !agent->new_name)
 		return -EPERM;
-	}
 
 	*new_folder = agent->new_folder;
 	*new_name = agent->new_name;
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 0bfdff9..dc3b9bb 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -227,7 +227,6 @@ static void cmd_connect(struct obex_session *os,
 			OBEX_FL_FIT_ONE_PACKET);
 
 	OBEX_ObjectSetRsp(obj, OBEX_RSP_CONTINUE, OBEX_RSP_SUCCESS);
-
 }
 
 static gboolean chk_cid(obex_t *obex, obex_object_t *obj, guint32 cid)
@@ -354,27 +353,26 @@ static void cmd_setpath(struct obex_session *os,
 	}
 
 	while (OBEX_ObjectGetNextHeader(obex, obj, &hi, &hd, &hlen)) {
-		if (hi == OBEX_HDR_NAME) {
-			if (os->name) {
-				debug("Ignoring multiple name headers");
-				break;
-			}
-
-			/*
-			 * This is because OBEX_UnicodeToChar() accesses
-			 * the string even if its size is zero
-			 */
-			if (hlen == 0) {
-				os->name = g_strdup("");
-				break;
-			}
+		if (hi != OBEX_HDR_NAME)
+			continue;
 
-			os->name = g_convert((const gchar *) hd.bs, hlen,
-					"UTF8", "UTF16BE", NULL, NULL, NULL);
+		if (os->name) {
+			debug("Ignoring multiple name headers");
+			break;
+		}
 
-			debug("Set path name: %s", os->name);
+		/* This is because OBEX_UnicodeToChar() accesses the string
+		   even if its size is zero */
+		if (hlen == 0) {
+			os->name = g_strdup("");
 			break;
 		}
+
+		os->name = g_convert((const gchar *) hd.bs, hlen,
+				"UTF8", "UTF16BE", NULL, NULL, NULL);
+
+		debug("Set path name: %s", os->name);
+		break;
 	}
 
 	os->cmds->setpath(obex, obj);
diff --git a/obexd/src/opp.c b/obexd/src/opp.c
index 390b074..c34899e 100644
--- a/obexd/src/opp.c
+++ b/obexd/src/opp.c
@@ -70,7 +70,7 @@ gint opp_chkput(obex_t *obex, obex_object_t *obj)
 					os->name ? os->name : "",
 					os->type ? os->type : "",
 					os->size, time, &new_folder,
-				       	&new_name);
+					&new_name);
 
 	if (ret < 0)
 		return -EPERM;
@@ -151,6 +151,4 @@ void opp_get(obex_t *obex, obex_object_t *obj)
 
 fail:
 	OBEX_ObjectSetRsp(obj, OBEX_RSP_FORBIDDEN, OBEX_RSP_FORBIDDEN);
-
-	return;
 }