From c44463f841c04e88bfdeff17a1dd9d501ae7e398 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Wed, 16 Feb 2005 10:03:52 +0000 Subject: [PATCH] fix buffer length calculation The send_hex buffer length has to include the separating space, too. --- amidi/amidi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);