diff --git a/src/cmdlib.cpp b/src/cmdlib.cpp index 7d8ba90f7..66a36ebff 100644 --- a/src/cmdlib.cpp +++ b/src/cmdlib.cpp @@ -609,7 +609,7 @@ int strbin (char *str) while ( (c = *p++) ) { if (c != '\\') { *str++ = c; - } else { + } else if (*p != 0) { switch (*p) { case 'a': *str++ = '\a'; @@ -712,7 +712,7 @@ FString strbin1 (const char *start) while ( (c = *p++) ) { if (c != '\\') { result << c; - } else { + } else if (*p) { switch (*p) { case 'a': result << '\a';