Do not loop infinitely if there is no argument passed to kiwix-serve.

If there is no argument, optind==argc==1. We must not try to look into argv[1]
but we need to break the loop anyway.
This commit is contained in:
Matthieu Gautier 2016-09-28 17:10:49 +02:00
parent cd623ce358
commit 8a9673191e

View File

@ -517,7 +517,7 @@ int main(int argc, char **argv) {
break;
}
} else {
if (optind < argc) {
if (optind <= argc) {
if (libraryFlag)
{
libraryPath = argv[optind++];