Don't dereference NULL pointer.

This commit is contained in:
mycroft 1993-04-20 22:05:34 +00:00
parent 1812390e23
commit 9188800c31

View File

@ -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