From 88c09c6f0af538d8dfad2cf2b7fb633339d0afc9 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sun, 12 Jun 2016 05:37:26 -0600 Subject: * Replace snprintf by sprintf in mailutil.c since Visual Studio has problems building when the former function in used. Reported by Ulf-Dietrich Braumann. --- imap/src/mailutil/mailutil.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'imap/src/mailutil') diff --git a/imap/src/mailutil/mailutil.c b/imap/src/mailutil/mailutil.c index 04198879..88408e72 100644 --- a/imap/src/mailutil/mailutil.c +++ b/imap/src/mailutil/mailutil.c @@ -484,11 +484,12 @@ void mailutil_add_sequence(char **sequence, size_t *len, unsigned long i, unsign return; if(i == j) - snprintf(tmp, sizeof(tmp), "%s%lu", *len == 0L ? "" : ",", i); + sprintf(tmp, "%s%lu", *len == 0L ? "" : ",", i); else if(j == nmsgs) - snprintf(tmp, sizeof(tmp), "%s%lu:*", *len == 0L ? "" : ",", i); + sprintf(tmp, "%s%lu:*", *len == 0L ? "" : ",", i); else - snprintf(tmp, sizeof(tmp), "%s%lu:%lu", *len == 0L ? "" : ",", i, j); + sprintf(tmp, "%s%lu:%lu", *len == 0L ? "" : ",", i, j); + tmp[sizeof(tmp)-1]='\0'; needed = strlen(*sequence ? *sequence : "") + strlen(tmp) + 1; if(needed > *len){ -- cgit v1.2.3-70-g09d2