fix "core show profile" parsing.
authorLuigi Rizzo <rizzo@icir.org>
Tue, 7 Nov 2006 23:14:04 +0000 (23:14 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Tue, 7 Nov 2006 23:14:04 +0000 (23:14 +0000)
Needs to go in 1.4 too, but ENOTIME now

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

main/asterisk.c

index 5d3e572..914ee9d 100644 (file)
@@ -447,13 +447,13 @@ static int handle_show_profile(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;