Fix panic caused by integer overflow.
Fix panic caused by integer overflow.

When String() was called on the maximum value of an integer type (eg
255 for uint8) this would cause an integer overflow, which would cause
an index error later in the code.

Fixed by re-arranging the code slightly.

Backport of upstream patch at https://go-review.googlesource.com/#/c/9255/.

sourcegraph/gostringer