File pointer-init.patch of Package ssmtp
Index: ssmtp/ssmtp.c
===================================================================
--- ssmtp.orig/ssmtp.c
+++ ssmtp/ssmtp.c
@@ -51,21 +51,21 @@ bool_t use_oldauth = False; /* use old
#define ARPADATE_LENGTH 32 /* Current date in RFC format */
char arpadate[ARPADATE_LENGTH];
-char *auth_user = (char)NULL;
-char *auth_pass = (char)NULL;
-char *auth_method = (char)NULL; /* Mechanism for SMTP authentication */
-char *mail_domain = (char)NULL;
-char *from = (char)NULL; /* Use this as the From: address */
+char *auth_user = NULL;
+char *auth_pass = NULL;
+char *auth_method = NULL; /* Mechanism for SMTP authentication */
+char *mail_domain = NULL;
+char *from = NULL; /* Use this as the From: address */
char *hostname;
char *mailhost = "mailhub";
-char *minus_f = (char)NULL;
-char *minus_F = (char)NULL;
+char *minus_f = NULL;
+char *minus_F = NULL;
char *gecos;
-char *prog = (char)NULL;
+char *prog = NULL;
char *root = NULL;
char *tls_cert = "/etc/ssl/certs/ssmtp.pem"; /* Default Certificate */
-char *uad = (char)NULL;
-char *config_file = (char)NULL; /* alternate configuration file */
+char *uad = NULL;
+char *config_file = NULL; /* alternate configuration file */
headers_t headers, *ht;
@@ -271,7 +271,7 @@ char *strip_post_ws(char *str)
p = (str + strlen(str));
while(isspace(*--p)) {
- *p = (char)NULL;
+ *p = 0;
}
return(p);
@@ -297,7 +297,7 @@ char *addr_parse(char *str)
q++;
if((p = strchr(q, '>'))) {
- *p = (char)NULL;
+ *p = 0;
}
#if 0
@@ -320,7 +320,7 @@ char *addr_parse(char *str)
q = strip_post_ws(p);
if(*q == ')') {
while((*--q != '('));
- *q = (char)NULL;
+ *q = 0;
}
(void)strip_post_ws(p);
@@ -373,13 +373,13 @@ bool_t standardise(char *str, bool_t *li
*linestart = False;
if((p = strchr(str, '\n'))) {
- *p = (char)NULL;
+ *p = 0;
*linestart = True;
/* If the line ended in "\r\n", then drop the '\r' too */
sl = strlen(str);
if(sl >= 1 && str[sl - 1] == '\r') {
- str[sl - 1] = (char)NULL;
+ str[sl - 1] = 0;
}
}
return(leadingdot);
@@ -400,7 +400,7 @@ void revaliases(struct passwd *pw)
while(fgets(buf, sizeof(buf), fp)) {
/* Make comments invisible */
if((p = strchr(buf, '#'))) {
- *p = (char)NULL;
+ *p = 0;
}
/* Ignore malformed lines and comments */
@@ -535,7 +535,7 @@ void rcpt_save(char *str)
#endif
/* Ignore missing usernames */
- if(*str == (char)NULL) {
+ if(*str == NULL) {
return;
}
@@ -592,7 +592,7 @@ void rcpt_parse(char *str)
}
/* End of string? */
- if(*(q + 1) == (char)NULL) {
+ if(*(q + 1) == NULL) {
got_addr = True;
}
@@ -600,7 +600,7 @@ void rcpt_parse(char *str)
if((*q == ',') && (in_quotes == False)) {
got_addr = True;
- *q = (char)NULL;
+ *q = 0;
}
if(got_addr) {
@@ -692,7 +692,7 @@ void header_save(char *str)
if(strncasecmp(ht->string, "From:", 5) == 0) {
#if 1
/* Hack check for NULL From: line */
- if(*(p + 6) == (char)NULL) {
+ if(*(p + 6) == NULL) {
return;
}
#endif
@@ -754,7 +754,7 @@ void header_parse(FILE *stream)
size_t size = BUF_SZ, len = 0;
char *p = (char *)NULL, *q;
bool_t in_header = True;
- char l = (char)NULL;
+ char l = 0;
int c;
while(in_header && ((c = fgetc(stream)) != EOF)) {
@@ -797,9 +797,9 @@ void header_parse(FILE *stream)
in_header = False;
default:
- *q = (char)NULL;
+ *q = 0;
if((q = strrchr(p, '\n'))) {
- *q = (char)NULL;
+ *q = 0;
}
if(len > 0) {
header_save(p);
@@ -816,7 +816,7 @@ void header_parse(FILE *stream)
if(in_header && l == '\n') {
/* Got EOF while reading the header */
if((q = strrchr(p, '\n'))) {
- *q = (char)NULL;
+ *q = 0;
}
header_save(p);
}
@@ -876,7 +876,7 @@ bool_t read_config()
char *rightside;
/* Make comments invisible */
if((p = strchr(buf, '#'))) {
- *p = (char)NULL;
+ *p = 0;
}
/* Ignore malformed lines and comments */
@@ -1316,7 +1316,7 @@ char *fd_gets(char *buf, int size, int f
buf[i++] = c;
}
}
- buf[i] = (char)NULL;
+ buf[i] = 0;
return(buf);
}
@@ -1748,7 +1748,7 @@ char **parse_options(int argc, char *arg
j = 0;
add = 1;
- while(argv[i][++j] != (char)NULL) {
+ while(argv[i][++j] != 0) {
switch(argv[i][j]) {
#ifdef INET6
case '6':