From ac3305f29c598cf391fd2d74afa94963b79ca3fa Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 18 Feb 2013 22:03:04 +0000 Subject: [PATCH] MFC r246860: Fix undefined behaviour in usr.bin/mail/util.c. Reported by: deeptech71@gmail.com git-svn-id: svn://svn.freebsd.org/base/stable/8@246950 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/mail/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/mail/util.c b/usr.bin/mail/util.c index af962c8ca..6851640a8 100644 --- a/usr.bin/mail/util.c +++ b/usr.bin/mail/util.c @@ -257,8 +257,8 @@ istrncpy(dest, src, dsize) { strlcpy(dest, src, dsize); - while (*dest) - *dest++ = tolower((unsigned char)*dest); + for (; *dest; dest++) + *dest = tolower((unsigned char)*dest); } /* -- 2.45.0