From: Michael Gernoth Date: Thu, 10 Jun 2010 21:06:56 +0000 (+0200) Subject: fix off by one X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/rigol/commitdiff_plain/759a1836af8a88a8eff08c731a894e380c829f02 fix off by one --- diff --git a/scope.c b/scope.c index 30f175a..eab7750 100644 --- a/scope.c +++ b/scope.c @@ -75,7 +75,7 @@ char *scope_get_string(struct scope *sc, char *cmd, int maxlen) unsigned char *buf; int res; - buf = malloc(maxlen); + buf = malloc(maxlen+1); if (buf == NULL) { perror("malloc(scope_get_strings)"); exit(EXIT_FAILURE);