summaryrefslogtreecommitdiff
path: root/strgen/strgen.c
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
commit65c03f32ee5adb8a3b51aaebd46d6aa84ad9f15c (patch)
tree31da92f1149b14d4739354b5637c46ab41acb700 /strgen/strgen.c
parent1d011b57d25b94028631a8ffa35c66b394c34916 (diff)
downloadopenttd-65c03f32ee5adb8a3b51aaebd46d6aa84ad9f15c.tar.xz
(svn r6247) -Fix(r6244): invalid arguments caused infinite loop
Diffstat (limited to 'strgen/strgen.c')
-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