Deleted Added
full compact
26c26
< * $FreeBSD: head/sys/teken/teken.c 261551 2014-02-06 13:28:06Z ray $
---
> * $FreeBSD: head/sys/teken/teken.c 286798 2015-08-15 08:42:33Z ed $
31a32
> #include <sys/limits.h>
37a39
> #include <limits.h>
408,411d409
< /*
< * Don't do math with the default value of 1 when a
< * custom number is inserted.
< */
412a411
> /* First digit. */
414,416c413,423
< t->t_nums[t->t_curnum] = 0;
< } else {
< t->t_nums[t->t_curnum] *= 10;
---
> t->t_nums[t->t_curnum] = c - '0';
> } else if (t->t_nums[t->t_curnum] < USHRT_MAX) {
> /*
> * Screen positions are stored as unsigned
> * shorts. There is no need to continue parsing
> * input once the value exceeds USHRT_MAX. It
> * would only allow for integer overflows when
> * performing arithmetic on the cursor position.
> */
> t->t_nums[t->t_curnum] =
> t->t_nums[t->t_curnum] * 10 + c - '0';
418,419d424
<
< t->t_nums[t->t_curnum] += c - '0';