logoalt Hacker News

voidUpdatetoday at 1:28 PM2 repliesview on HN

you could check if ret > ret * 10 + characters[i]-48, if so it has wrapped around and you return an error


Replies

thomashabets2today at 3:59 PM

For unsigned that could work, but signed overflow is UB.

Thieztoday at 2:40 PM

[dead]