From ea052d4a1a56414b0d0ed945caafd356b07bdc5e Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Sat, 23 Oct 2010 23:18:10 +0200 Subject: [PATCH] bugfix: set .s to beginning of string --- str.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/str.c b/str.c index e4c69232..8196447c 100644 --- a/str.c +++ b/str.c @@ -29,7 +29,8 @@ str *coap_new_string(size_t size) { return NULL; } - memset(s, 0, sizeof(str) + size + 1); + memset(s, 0, sizeof(str)); + s->s = ((unsigned char *)s) + sizeof(str); return s; }