aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/dialogs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/m4/dialogs.cpp')
-rw-r--r--engines/m4/dialogs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp
index a7104537f5..101f21f48c 100644
--- a/engines/m4/dialogs.cpp
+++ b/engines/m4/dialogs.cpp
@@ -297,7 +297,7 @@ Dialog::Dialog(MadsM4Engine *vm, const char *msgData, const char *title): View(v
char *lineP = &dialogLine[0];
char *cmdP = NULL;
- while (*(srcP - 1) != '\0') {
+ while (srcP && *(srcP - 1) != '\0') {
if ((*srcP == '\n') || (*srcP == '\0')) {
// Line completed
*lineP = '\0';