File fix-build-with-gcc14.patch of Package ssmtp
Index: ssmtp-2.64/ssmtp.c
===================================================================
--- ssmtp-2.64.orig/ssmtp.c
+++ ssmtp-2.64/ssmtp.c
@@ -525,7 +525,7 @@ void rcpt_save(char *str)
#endif
/* Ignore missing usernames */
- if(*str == NULL) {
+ if(*str == '\0') {
return;
}
@@ -582,7 +582,7 @@ void rcpt_parse(char *str)
}
/* End of string? */
- if(*(q + 1) == NULL) {
+ if(*(q + 1) == '\0') {
got_addr = True;
}
@@ -682,7 +682,7 @@ void header_save(char *str)
if(strncasecmp(ht->string, "From:", 5) == 0) {
#if 1
/* Hack check for NULL From: line */
- if(*(p + 6) == NULL) {
+ if(*(p + 6) == '\0') {
return;
}
#endif
@@ -1506,7 +1506,7 @@ int ssmtp(char *argv[])
else {
#endif
memset(buf, 0, bufsize);
- to64frombits(buf, auth_user, strlen(auth_user));
+ to64frombits((unsigned char*)buf, (const unsigned char*)auth_user, strlen(auth_user));
if (use_oldauth) {
outbytes += smtp_write(sock, "AUTH LOGIN %s", buf);
}
@@ -1518,7 +1518,7 @@ int ssmtp(char *argv[])
}
/* we assume server asked us for Username */
memset(buf, 0, bufsize);
- to64frombits(buf, auth_user, strlen(auth_user));
+ to64frombits((unsigned char*)buf, (const unsigned char*)auth_user, strlen(auth_user));
outbytes += smtp_write(sock, buf);
}
@@ -1528,7 +1528,7 @@ int ssmtp(char *argv[])
}
memset(buf, 0, bufsize);
- to64frombits(buf, auth_pass, strlen(auth_pass));
+ to64frombits((unsigned char*)buf, (const unsigned char*)auth_pass, strlen(auth_pass));
#ifdef MD5AUTH
}
#endif
Index: ssmtp-2.64/base64.c
===================================================================
--- ssmtp-2.64.orig/base64.c
+++ ssmtp-2.64/base64.c
@@ -12,7 +12,6 @@
* This code borrowed from fetchmail sources by
* Eric S. Raymond <esr@snark.thyrsus.com>.
*/
-#include <ctype.h>
static const char base64digits[] =
@@ -29,7 +28,7 @@ static const char base64val[] = {
BAD, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,BAD, BAD,BAD,BAD,BAD
};
-#define DECODE64(c) (isascii(c) ? base64val[c] : BAD)
+#define DECODE64(c) (((unsigned)(c) < 128) ? base64val[(unsigned char)(c)] : BAD)
void to64frombits(unsigned char *out, const unsigned char *in, int inlen)
/* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
Index: ssmtp-2.64/xgethostname.c
===================================================================
--- ssmtp-2.64.orig/xgethostname.c
+++ ssmtp-2.64/xgethostname.c
@@ -39,6 +39,7 @@
NULL is returned and errno is set.
*/
+#define _POSIX_C_SOURCE 200809L
#include <sys/param.h> /* For MAXHOSTNAMELEN */
#include <stdlib.h>
#include <errno.h>