mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 10a011b94ebd2b3049aa255abff91c0628330112
parent 12d38b8a1307a6df070f0f62a1378faa58a5d043
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Sat,  3 Jun 2017 17:23:41 +0200

blaze822: blaze822_addr: use memcpy instead of strcpy, we know the length

Diffstat:
blaze822.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/blaze822.c b/blaze822.c @@ -187,7 +187,8 @@ blaze822_addr(char *s, char **dispo, char **addro) *c-- = 0; while (c > disp && iswsp(*c)) *c-- = 0; - strcpy(addr, disp); + c++; + memcpy(addr, disp, (c - disp) + 1); c = disp; *c = 0; } @@ -216,7 +217,8 @@ blaze822_addr(char *s, char **dispo, char **addro) if (*disp && !*addr && strchr(disp, '@')) { // just mail address was given - strcpy(addr, disp); + c++; + memcpy(addr, disp, (c - disp) + 1); *disp = 0; }