diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2018-01-23 07:52:23 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-01-24 11:46:27 +0000 |
commit | 0d584d9fedb1050d4b8a1ec024f36cff1ca48935 (patch) | |
tree | 3e63d16fabd5a4f3b3bbef15ea9bb8903af230c5 /ui/util.c | |
parent | 7e37a7db558563e665f7b356d6ee4e8a1bd82f9c (diff) |
ui: don't g_assert() in get_args_as_string(), but return empty string for no arguments case.
Rework e861a112103ed4d1f2fa153932bcf86f120e3907 by returning empty string.
g_assert() seems to be not understand by clang scan.
Change-Id: Iade2d81aa22eecf563a465cb86e694e3e0f853df
Reviewed-on: https://code.wireshark.org/review/25441
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/util.c')
-rw-r--r-- | ui/util.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -53,9 +53,6 @@ get_args_as_string(int argc, char **argv, int optindex) int i; char *argstring; - /* We don't allow a null-list call */ - g_assert(argc - optindex > 0); - /* * Find out how long the string will be. */ @@ -66,6 +63,12 @@ get_args_as_string(int argc, char **argv, int optindex) } /* + * If no arguments, return empty string + */ + if (len == 0) + return g_strdup(""); + + /* * Allocate the buffer for the string. */ argstring = (char *)g_malloc(len); |