[PATCH obexd 2/9] client: fix obc_session_get_buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

Size 0 should be reported if no transfer exists. Some existing code
relies on this behavior.
---
 client/session.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/client/session.c b/client/session.c
index 85f466a..e113d1f 100644
--- a/client/session.c
+++ b/client/session.c
@@ -1128,8 +1128,12 @@ const char *obc_session_get_buffer(struct obc_session *session, size_t *size)
 	const char *buf;
 
 	transfer = obc_session_get_transfer(session);
-	if (transfer == NULL)
+	if (transfer == NULL) {
+		if (size != NULL)
+			*size = 0;
+
 		return NULL;
+	}
 
 	buf = obc_transfer_get_buffer(transfer, size);
 
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux