* libmisc/setupenv.c: Prefer snprintf to sprintf, even if a small

context indicates no issues.
	* libmisc/setupenv.c: Avoid implicit conversion of pointers to
	booleans.
This commit is contained in:
nekral-guest
2009-04-24 22:46:06 +00:00
parent 42e72c418d
commit 7646230de2
4 changed files with 26 additions and 6 deletions

View File

@@ -58,9 +58,12 @@ void mailcheck (void)
if (NULL != mailbox) {
char *newmail;
size_t len = strlen (mailbox) + 5;
int wlen;
newmail = xmalloc (len);
snprintf (newmail, len, "%s/new", mailbox);
wlen = snprintf (newmail, len, "%s/new", mailbox);
assert (wlen == (int) len - 1);
if (stat (newmail, &statbuf) != -1 && statbuf.st_size != 0) {
if (statbuf.st_mtime > statbuf.st_atime) {
free (newmail);