Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Big Insight #2 is that atoi() behaves as a (bad) hash function on ordinary text. It consumes characters and updates a 16-bit integer.

I could have sworn I remembered atoi() being defined to return 0 for invalid input (i.e. text not representing an integer in base ten).



That would be true of one using a libc, but in a boot sector, you only have the bios, so the atoi being referenced is the one defined in c near the beginning of the article


Ah, I somehow skipped over that exact code block on first read.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: