fix buffer length calculation

The send_hex buffer length has to include the separating space, too.
This commit is contained in:
Clemens Ladisch 2005-02-16 10:03:52 +00:00
parent d7d4a53d59
commit c44463f841

View file

@ -381,7 +381,7 @@ void add_send_hex_data(const char *str)
int length; int length;
char *s; 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); s = my_malloc(length);
if (send_hex) { if (send_hex) {
strcpy(s, send_hex); strcpy(s, send_hex);