From: Clemens Ladisch Date: Wed, 16 Feb 2005 10:03:52 +0000 (+0000) Subject: fix buffer length calculation X-Git-Tag: v1.0.9rc1~10 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=c44463f841c04e88bfdeff17a1dd9d501ae7e398;p=alsa-utils.git fix buffer length calculation The send_hex buffer length has to include the separating space, too. --- diff --git a/amidi/amidi.c b/amidi/amidi.c index 2e25f80..864d7c3 100644 --- a/amidi/amidi.c +++ b/amidi/amidi.c @@ -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);