diff --git a/src/gmnlm.c b/src/gmnlm.c

index def42ac8b1af405da29681d29cd7b9d07b727f11..07d0000babe7cd51876ead407e83c3062adfda56 100644

--- a/src/gmnlm.c

+++ b/src/gmnlm.c

@@ -380,6 +380,9 @@ assert(0); // Not supposed to happen

case '\t':

*col = *col + (8 - *col % 8);

break;

+ case '\r':

+ if (!s[i+1]) break;

+ /* fallthrough */

default:

if (iscntrl(s[i])) {

s[i] = '.';