commit 66b65e18ee0919a32e9dc29b7775a2f3f99b8da7
parent 58014800625d7facfac52c0d73fdc2a8759dd166
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Sun, 14 May 2023 03:11:34 +0000
Check that the mbox separater line is printed
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pop3.c b/pop3.c
@@ -1,4 +1,4 @@
-/* $Id: pop3.c,v 1.9 2023/03/02 01:14:21 jacob Exp $ */
+/* $Id: pop3.c,v 1.10 2023/05/14 03:11:34 jacob Exp $ */
/*
* Copyright (c) 2022 Jacob R. Edwards
@@ -462,12 +462,15 @@ mbox(FILE *fp, char *msg, char **unused)
int escape;
int len;
time_t tim;
+ char *stim;
if (pop_retr(fp, msg))
return -1;
tim = time(NULL);
- printf("From <unknown> %s", ctime(&tim));
+ stim = ctime(&tim);
+ if (!stim || printf("From <unknown> %s", stim) < 0)
+ return -1;
while ((len = pop_readmsg(fp, buf)) > 0) {
escape = strncmp(buf, "From ", 5) == 0;
if (printf(escape ? ">%s\n" : "%s\n", buf) < 0)