Hi Tanguy, great job!
2012/1/24 Tanguy LE CARROUR <[email protected]>:
> I hope I've fixed all the bugs in my patch, but I have one last small
> question: Do I really need to check if BUFSIZ is defined?
Remaining quirks that I can see:
- You can drop -lm as well, since it's no longer be required.
get_line()
- The body of the while loop should probably be indented.
- fgets(buf + last, buf_size - last, f); then you can realloc unconditionally
read_proc()
- random trick: you could substitute 'buff_size = 11' with 'buff_size
= sizeof "/proc//maps"' (includes the '\0'), then drop the comment [or
use Richard's version]
- "_ * sizeof(char)" : no need to bother, I think "sizeof (char)" is 1
by definition
- there is a remaining indentation problem with the first two lines in
the while() loop and in other spots, make sure you set your tabs to
print as 8 spaces.
Unnecessary/unrelated:
if (nread < 7) {
fprintf(stderr, "I don't recognize format of /proc/%d/maps.
(nread=%d)\n", pid, nread);
+ fclose(f);
+ closedir(d);
exit(1);
}
But aside from these minor issues and the one spotted by Richard, the
patch looks good to me.
--
Jérémie Koenig <[email protected]>
http://jk.fr.eu.org/
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive:
http://lists.debian.org/CA+kCSAYN3zSHN+URG43eMh8s7xCzG=o14j4-f14mnp-igo8...@mail.gmail.com