From 2bcaff7589c7fe0816bb5f08b500fdc942c13d89 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 26 Dec 2015 15:04:39 +0100 Subject: marshalled arrays are not empty-element-terminated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/client.c') diff --git a/src/client.c b/src/client.c index 9df327e..c4f2987 100644 --- a/src/client.c +++ b/src/client.c @@ -59,7 +59,7 @@ send_command(enum command cmd, size_t n, const char *restrict msg) size_t measure_array(char *array[]) { - size_t rc = 1; + size_t rc = 0; for (; *array; array++) rc += strlen(*array) + 1; return rc * sizeof(char); @@ -80,7 +80,6 @@ store_array(char *restrict storage, char *array[]) storage = stpcpy(storage, *array); *storage++ = 0; } - *storage++ = 0; return storage; } -- cgit v1.2.3-70-g09d2