From: Hong Shick Pak Date: Thu, 6 Nov 2014 05:33:20 +0000 (-0500) Subject: fix minor valgrind read error X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=24fbdfb2b81ab2a1c8834e38d644f66a1e5653e4;p=smdp.git fix minor valgrind read error --- diff --git a/src/cstring.c b/src/cstring.c index d321260..558a786 100644 --- a/src/cstring.c +++ b/src/cstring.c @@ -76,7 +76,7 @@ void cstring_strip(cstring_t *self, int pos, int len) { } return; } - memmove(&self->text[pos], &self->text[pos+len], self->size - pos); + memmove(&self->text[pos], &self->text[pos+len], self->size - pos - len+1); self->size -= len; }