]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CID 1455245
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 3 Nov 2019 19:34:10 +0000 (13:34 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 3 Nov 2019 19:34:10 +0000 (13:34 -0600)
src/modules/proto_control/radmin.c

index a2cf6a9ff025127d86ead88620b3e92e792163d2..4b33498f37cd1e9c4169963450f3199d2ace1d7d 100644 (file)
@@ -456,34 +456,17 @@ static char *my_readline(char const *prompt, FILE *fp_in, FILE *fp_out)
                fprintf(stderr, "Input line too long\n");
                fr_exit_now(EXIT_FAILURE);
        }
-
        *p = '\0';
 
-       /*
-        *      Strip off leading spaces.
-        */
-       for (p = line; *p != '\0'; p++) {
-               if ((p[0] == ' ') ||
-                   (p[0] == '\t')) {
-                       line = p + 1;
-                       continue;
-               }
-
-               /*
-                *      Return an empty string.
-                */
-               if (p[0] == '#') {
-                       line[0] = '\0';
-                       break;
-               }
-
-               break;
-       }
+       fr_skip_whitespace(line);
 
        /*
         *      Comments: keep going.
         */
-       if (!line) return line;
+       if (line[0] == '#') {
+               *line = '\0';
+               return line;
+       }
 
        /*
         *      Strip off CR / LF