diff options
| -rw-r--r-- | snake/snake/move.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/snake/snake/move.c b/snake/snake/move.c index cbfeaa3c..df985831 100644 --- a/snake/snake/move.c +++ b/snake/snake/move.c @@ -601,7 +601,10 @@ getcap() KR = tgetstr("kr", &ap); KU = tgetstr("ku", &ap); KD = tgetstr("kd", &ap); - Klength = strlen(KL); + if (KL && KR && KU && KD) + Klength = strlen(KL); + else + Klength = 0; /* NOTE: If KL, KR, KU, and KD are not * all the same length, some problems * may arise, since tests are made on |
