On Thu, Jan 02, 2014 at 04:24:04PM +0100, Jan Kratochvil wrote:
On Wed, 25 Dec 2013 23:10:50 +0100, Mark Wielaard wrote:
> It would be zero in the very unlikely case atoi doesn't see any digits.
If you want to check /proc files validity there should be strtol and not
atoi.
"Tgid: 42foo\n" still gets parsed as 42 by the code above.
OK, it is somewhat unlikely that the /proc file would be that garbled,
but with strtol we can at least detect it.
Thanks,
Mark