X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/rigol/blobdiff_plain/78fb09842aa3a0b87a4fe84a1ab93bfc7252d934..759a1836af8a88a8eff08c731a894e380c829f02:/scope.c 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);