wmbiff: Fix segfault when -display or -geometry argument is missing.

This commit is contained in:
Gabriel VLASIU 2013-04-04 18:43:30 +03:00 committed by Carlos R. Mafra
parent 3849e598ac
commit 8d972d5f44

View file

@ -475,11 +475,11 @@ void openXwindow(int argc, const char *argv[],
}
for (i = 1; argv[i]; i++) {
if (!strcmp(argv[i], "-display")) {
if (!strcmp(argv[i], "-display") && i < argc - 1) {
display_name = argv[i + 1];
i++;
}
if (!strcmp(argv[i], "-geometry")) {
if (!strcmp(argv[i], "-geometry") && i < argc - 1) {
geometry = argv[i + 1];
i++;
}