diff --git a/libiberty/argv.c b/libiberty/argv.c index 10d5c3060b5bf..7ec018b1b2207 100644 --- a/libiberty/argv.c +++ b/libiberty/argv.c @@ -507,12 +507,12 @@ Returns zero if @var{argv} is NULL. int countargv (char * const *argv) { - int argc; + int argc = 0; if (argv == NULL) return 0; - for (argc = 0; argv[argc] != NULL; argc++) - continue; + while (argv[argc++]) + ; return argc; }