summaryrefslogtreecommitdiff
path: root/strgen
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2006-08-30 22:32:25 +0000
committerglx <glx@openttd.org>2006-08-30 22:32:25 +0000
commitf91fce66cb78e5ab67e77a47c72242c0048e6514 (patch)
tree31da92f1149b14d4739354b5637c46ab41acb700 /strgen
parent744840c3daed0828e4fc8e3fca843a29bf6df7d8 (diff)
downloadopenttd-f91fce66cb78e5ab67e77a47c72242c0048e6514.tar.xz
(svn r6247) -Fix(r6244): invalid arguments caused infinite loop
Diffstat (limited to 'strgen')
-rw-r--r--strgen/strgen.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/strgen/strgen.c b/strgen/strgen.c
index 25293c06e..8b7bd761f 100644
--- a/strgen/strgen.c
+++ b/strgen/strgen.c
@@ -1285,12 +1285,17 @@ int CDECL main(int argc, char* argv[])
if (argc > 2 && (strcmp(argv[1], "-s") == 0 || strcmp(argv[1], "--source_dir") == 0)) {
src_dir = replace_pathsep(argv[2]);
argc -= 2, argv += 2;
+ continue;
}
if (argc > 2 && (strcmp(argv[1], "-d") == 0 || strcmp(argv[1], "--dest_dir") == 0)) {
dest_dir = replace_pathsep(argv[2]);
argc -= 2, argv += 2;
+ continue;
}
+
+ fprintf(stderr, "Invalid arguments\n");
+ return 0;
}
if (dest_dir == NULL) dest_dir = src_dir; // if dest_dir is not specified, it equals src_dir