Diff between 7ae2fb58d0c43e03df2d810c7ce47be1b4020084 and 4cd67264c36dca10ab64608efa94f02556abdc03

Changed Files

File Additions Deletions Status
client/gatt.c +2 -2 modified

Full Patch

diff --git a/client/gatt.c b/client/gatt.c
index 737ecea..0a3adb8 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -421,7 +421,7 @@ static void write_attribute(GDBusProxy *proxy, char *arg)
 	struct iovec iov;
 	uint8_t value[512];
 	char *entry;
-	int i;
+	unsigned int i;
 
 	for (i = 0; (entry = strsep(&arg, " \t")) != NULL; i++) {
 		long int val;
@@ -430,7 +430,7 @@ static void write_attribute(GDBusProxy *proxy, char *arg)
 		if (*entry == '\0')
 			continue;
 
-		if (i > 512) {
+		if (i >= G_N_ELEMENTS(value)) {
 			rl_printf("Too much data\n");
 			return;
 		}