popcheck.c: fix potential buffer overflows by using asprintf instead of sprintf.