(tputs): Don't let ospeed overrun the speeds array.

This commit is contained in:
David J. MacKenzie 1995-11-30 20:05:01 +00:00
parent 6e2f2e9215
commit c7c5360fe5

View file

@ -300,8 +300,10 @@ tputs (str, nlines, outfun)
#else
if (ospeed == 0)
speed = tputs_baud_rate;
else
else if (ospeed > 0 && ospeed < (sizeof speeds / sizeof speeds[0]))
speed = speeds[ospeed];
else
speed = 0;
#endif
if (!str)