summaryrefslogtreecommitdiff
path: root/imap/src
diff options
context:
space:
mode:
Diffstat (limited to 'imap/src')
-rw-r--r--imap/src/c-client/imap4r1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/imap/src/c-client/imap4r1.c b/imap/src/c-client/imap4r1.c
index a41973b5..2233da6e 100644
--- a/imap/src/c-client/imap4r1.c
+++ b/imap/src/c-client/imap4r1.c
@@ -3392,9 +3392,9 @@ IMAPPARSEDREPLY *imap_send_literal (MAILSTREAM *stream,char *tag,char **s,
sprintf (u, (X), (Y)); \
len = strlen(u); \
if(len < remain){ \
+ strncpy(t, u, remain); \
+ t[remain-1] = '\0'; \
remain -= len; \
- strncpy(t, u, strlen(u)); \
- t[strlen(u)] = '\0'; \
t += strlen (t); \
} \
} \
@@ -3409,7 +3409,7 @@ long imap_search_x_gm_ext1 (MAILSTREAM *stream, char *charset, SEARCHPGM *pgm, l
IMAPPARSEDREPLY *reply;
unsigned long i,j,k;
MESSAGECACHE *elt;
- size_t remain = sizeof(s) - 1, len;
+ size_t remain = sizeof(s), len;
u[0] = s[0] = '\0';
t = s;