]> git.zerfleddert.de Git - rigol/blobdiff - scope.c
fix off by one
[rigol] / scope.c
diff --git a/scope.c b/scope.c
index 30f175a7de8f9a7ceea01f28b4d0f8b1082f932e..eab7750c64c76fa8dd3dbb76354f2a8d03e74d64 100644 (file)
--- 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);
Impressum, Datenschutz