Set alarm for extended options.

Instead of clearing the alarm, set it to two seconds;
Previously, this could, potentially, not finish at all on some telnet
clients, which is definitely bad. This is a reasonable workaround.
This commit is contained in:
Kevin Lange 2013-03-07 19:43:48 -08:00
parent 4a907ca8ee
commit 634c7d3e97
1 changed files with 2 additions and 2 deletions

View File

@ -443,14 +443,14 @@ int main(int argc, char ** argv) {
if (sb[0] == TTYPE) {
/* This was a response to the TTYPE command, meaning
* that this should be a terminal type */
alarm(0);
alarm(2);
strcpy(term, &sb[2]);
done++;
}
else if (sb[0] == NAWS) {
/* This was a response to the NAWS command, meaning
* that this should be a window size */
alarm(0);
alarm(2);
terminal_width = sb[2];
done++;
}