Add documented patch series and build instructions

This commit is contained in:
2025-12-14 13:20:03 +01:00
parent 8f89723b4f
commit 9a972c418a
5 changed files with 742 additions and 1 deletions

View File

@@ -0,0 +1,44 @@
From 789c2d97f672fd25cb0f5495892f13eda9fef440 Mon Sep 17 00:00:00 2001
From: Christoph <ckubu@oopen.de>
Date: Sun, 14 Dec 2025 11:49:00 +0100
Subject: [PATCH 3/4] Replace gets() with fgets()
---
src/mtest/mtest.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/mtest/mtest.c b/src/mtest/mtest.c
index 69af568..c15a853 100644
--- a/src/mtest/mtest.c
+++ b/src/mtest/mtest.c
@@ -38,6 +38,7 @@
#include <signal.h>
#include "c-client.h"
#include "imap4r1.h"
+#include <string.h>
/* Excellent reasons to hate ifdefs, and why my real code never uses them */
@@ -595,7 +596,8 @@ void status (MAILSTREAM *stream)
void prompt (char *msg,char *txt)
{
printf ("%s",msg);
- gets (txt);
+ if (!fgets (txt, sizeof (txt), stdin)) txt[0] = '\0';
+ txt[strcspn (txt, "\r\n")] = '\0';
}
/* Interfaces to C-client */
@@ -779,7 +781,8 @@ void smtptest (long debug)
puts (" Msg (end with a line with only a '.'):");
body->type = TYPETEXT;
*text = '\0';
- while (gets (line)) {
+ while (fgets (line, sizeof (line), stdin)) {
+ line[strcspn (line, "\r\n")] = '\0';
if (line[0] == '.') {
if (line[1] == '\0') break;
else strcat (text,".");
--
2.47.3