From 8ef6192b4963b293f7539d46b260cf514ac3acb2 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 2 Apr 2006 11:37:22 +0000 Subject: [PATCH] Fixed string explosion bug (should return 0 with empty string) --- src/common/command.c | 2 +- weechat/src/common/command.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/command.c b/src/common/command.c index c5f8d021a..021cd3d2c 100644 --- a/src/common/command.c +++ b/src/common/command.c @@ -464,7 +464,7 @@ explode_string (char *string, char *separators, int num_items_max, n_items = num_items_max; - if (string == NULL) + if (!string || !string[0]) return NULL; if (num_items_max == 0) diff --git a/weechat/src/common/command.c b/weechat/src/common/command.c index c5f8d021a..021cd3d2c 100644 --- a/weechat/src/common/command.c +++ b/weechat/src/common/command.c @@ -464,7 +464,7 @@ explode_string (char *string, char *separators, int num_items_max, n_items = num_items_max; - if (string == NULL) + if (!string || !string[0]) return NULL; if (num_items_max == 0)