]> git.alsa-project.org Git - alsa-utils.git/commitdiff
fix buffer length calculation
authorClemens Ladisch <clemens@ladisch.de>
Wed, 16 Feb 2005 10:03:52 +0000 (10:03 +0000)
committerClemens Ladisch <clemens@ladisch.de>
Wed, 16 Feb 2005 10:03:52 +0000 (10:03 +0000)
The send_hex buffer length has to include the separating space, too.

amidi/amidi.c

index 2e25f80313f64e66fa690cb72968c53b6cd33df8..864d7c3d55d22863275f781f7fcaf7804e080268 100644 (file)
@@ -381,7 +381,7 @@ void add_send_hex_data(const char *str)
        int length;
        char *s;
 
-       length = (send_hex ? strlen(send_hex) : 0) + strlen(str) + 1;
+       length = (send_hex ? strlen(send_hex) + 1 : 0) + strlen(str) + 1;
        s = my_malloc(length);
        if (send_hex) {
                strcpy(s, send_hex);