]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix argument parsing for the "core show profile" CLI command
authorRussell Bryant <russell@russellbryant.com>
Thu, 9 Nov 2006 16:04:38 +0000 (16:04 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 9 Nov 2006 16:04:38 +0000 (16:04 +0000)
(fixed by rizzo in his branch, team/rizzo/astobj2)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47369 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c

index b8a93e9ce161803db5fd31d8cb8a3995991f5dbc..f70893e540950608c11a98d9e9380ae93b5d0368 100644 (file)
@@ -448,13 +448,13 @@ static int handle_show_profile_deprecated(int fd, int argc, char *argv[])
 
        min = 0;
        max = prof_data->entries;
-       if  (argc >= 3) { /* specific entries */
-               if (isdigit(argv[2][0])) {
-                       min = atoi(argv[2]);
-                       if (argc == 4 && strcmp(argv[3], "-"))
-                               max = atoi(argv[3]);
+       if  (argc > 3) { /* specific entries */
+               if (isdigit(argv[3][0])) {
+                       min = atoi(argv[3]);
+                       if (argc == 5 && strcmp(argv[4], "-"))
+                               max = atoi(argv[4]);
                } else
-                       search = argv[2];
+                       search = argv[3];
        }
        if (max > prof_data->entries)
                max = prof_data->entries;