diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 0accce7e942..30309a894ba 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -87,8 +87,11 @@ const char *_debug_get_input_default() { printf("> "); fgets(newinpbuf, 254, stdin); - if (strlen(newinpbuf) != 0) + size_t l = strlen(newinpbuf); + if (l > 0 && newinpbuf[0] != '\n') { + if (newinpbuf[l-1] == '\n') newinpbuf[l-1] = 0; memcpy(inputbuf, newinpbuf, 256); + } return inputbuf; }