[PATCH 4/9] gdhcp: Only write terminating NUL once at end of string

Peter Meerwald pmeerw at pmeerw.net
Tue Sep 10 06:46:15 PDT 2013


---
 gdhcp/client.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index e6106d1..a3a4475 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1830,8 +1830,8 @@ static char *malloc_option_value_string(uint8_t *option, GDHCPOptionType type)
 		if (len <= 0)
 			break;
 		*dest++ = ' ';
-		*dest = '\0';
 	}
+	*dest = '\0';
 
 	return ret;
 }
-- 
1.7.9.5




More information about the connman mailing list