*new* check_snprintf: using the return value of snprintf as a limitter
Sometimes people do stuff like:
len = snprintf(buf, sizeof(buf), "asdfasdf");
memcpy(buf2, buf, len);
But that's nonsense, if you don't care about writing past sizeof(buf) then
why even use snprintf() instead of sprintf()?
Actually it turns out that this test mostly prints false positives. The
strings fit inside the buffers and snprintf() was only used out of habit.
Hopefully I will write a better way of analyzing printf strings to find
the maximum length. That should get rid of most of the false positives and
is useful for finding buffer overflows as well.
Signed-off-by: Dan Carpenter <error27@gmail.com>