From: Leon de Rooij Date: Fri, 24 Apr 2009 09:39:44 +0000 (+0200) Subject: freeswitch plugin: Changed malloc and snprintf size to +3 instead of +2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f0d8297654872643a02b513cd8119ca0bf0ca221;p=collectd.git freeswitch plugin: Changed malloc and snprintf size to +3 instead of +2 --- diff --git a/src/freeswitch.c b/src/freeswitch.c index 52ff0883..e171aa33 100644 --- a/src/freeswitch.c +++ b/src/freeswitch.c @@ -419,7 +419,7 @@ static void fs_submit (const fs_command_t *fc, DEBUG (fm->type); DEBUG ("mv->value"); - //DEBUG (mv->value); + DEBUG (mv->value); value_t values[1]; value_list_t vl = VALUE_LIST_INIT; @@ -448,8 +448,8 @@ static int fs_read_command (fs_command_t *fc) /* can't the following be done nicer ? */ char *line; - line = (char *) malloc (strlen(fc->line)+2); - snprintf(line, strlen(fc->line)+2, "%s\n\n", fc->line); + line = (char *) malloc (strlen(fc->line)+3); + snprintf(line, strlen(fc->line)+3, "%s\n\n", fc->line); esl_send_recv(&esl_handle, line); fc->buffer_fill = 0;