From c0a03f48bc69ced702fe99e9f9dba3610390d947 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 2 Oct 2013 09:48:25 +0200 Subject: [PATCH] Fixed freerdp_command_line_parse_comma_separated_values, setting count correct now, if there is no data in the list. --- client/common/cmdline.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index dbe26d978..9fa8fe48f 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -21,6 +21,8 @@ #include "config.h" #endif +#include + #include #include @@ -418,7 +420,7 @@ int freerdp_client_add_dynamic_channel(rdpSettings* settings, int count, char** return 0; } -char** freerdp_command_line_parse_comma_separated_values(char* list, int* count) +static char** freerdp_command_line_parse_comma_separated_values(char* list, int* count) { char** p; char* str; @@ -428,6 +430,9 @@ char** freerdp_command_line_parse_comma_separated_values(char* list, int* count) nArgs = nCommas = 0; + assert(NULL != count); + + *count = 0; if (!list) return NULL; @@ -456,7 +461,7 @@ char** freerdp_command_line_parse_comma_separated_values(char* list, int* count) return p; } -char** freerdp_command_line_parse_comma_separated_values_offset(char* list, int* count) +static char** freerdp_command_line_parse_comma_separated_values_offset(char* list, int* count) { char** p;