logoalt Hacker News

voidUpdateyesterday 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

thomashabets2yesterday at 3:59 PM

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

Thiezyesterday at 2:40 PM

[dead]