]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better commands
authorAlan T. DeKok <aland@freeradius.org>
Wed, 1 Aug 2018 19:46:51 +0000 (15:46 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 1 Aug 2018 19:46:51 +0000 (15:46 -0400)
src/lib/server/command.c

index 67ceb44301fe80761d9178c8ed04509d97c63b63..14011518db4ca223639f9a10f78575e0bd794b0c 100644 (file)
@@ -1964,8 +1964,19 @@ int fr_command_str_to_argv(fr_cmd_t *head, fr_cmd_info_t *info, char const *text
        char const *word, *p, *q;
        fr_cmd_t *cmd;
 
-       if ((info->argc < 0) || (info->max_argc <= 0) || !text || !head) {
-               fr_strerror_printf("Invalid arguments passed to parse routine.");
+       if ((info->argc < 0) || (info->max_argc <= 0)) {
+               fr_strerror_printf("argc / max_argc must be greater than zero");
+               return -1;
+       }
+
+       if (!text) {
+               fr_strerror_printf("No string to split.");
+               return -1;
+       }
+
+
+       if (!head) {
+               fr_strerror_printf("No commands to run.");
                return -1;
        }