Skip to content
Snippets Groups Projects
Commit ca0d64e4 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Eliminate some unnecessary typecasts and parens

parent 7f1eb25d
No related branches found
No related tags found
No related merge requests found
Pipeline #8684 passed
......@@ -1255,7 +1255,7 @@ int file_to_netmail(FILE* infile, const char* title, fidoaddr_t dest, const char
else if (len < 1)
return 0;
rewind(infile);
if ((buf = (char *)malloc(len + 1)) == NULL) {
if ((buf = malloc(len + 1)) == NULL) {
lprintf(LOG_ERR, "ERROR line %d allocating %lu for file to netmail buf", __LINE__, len);
return 0;
}
......@@ -2381,7 +2381,7 @@ char* process_areamgr(fidoaddr_t addr, char* inbuf, const char* subj, const char
}
}
p = (char *)inbuf;
p = inbuf;
while (*p == CTRL_A) { /* Skip kludge lines 11/05/95 */
FIND_CHAR(p, '\r');
......@@ -5070,7 +5070,7 @@ ulong export_echomail(const char* sub_code, const nodecfg_t* nodecfg, bool resca
lprintf(LOG_DEBUG, "Exporting %s message #%u from %s to %s in area: %s"
, scfg.sub[subnum]->code, msg.hdr.number, msg.from, msg.to, tag);
fmsgbuflen = strlen((char *)buf) + 4096; /* over alloc for kludge lines */
fmsgbuflen = strlen(buf) + 4096; /* over alloc for kludge lines */
fmsgbuf = malloc(fmsgbuflen);
if (!fmsgbuf) {
lprintf(LOG_ERR, "ERROR line %d allocating %lu bytes for fmsgbuf"
......@@ -5196,7 +5196,7 @@ ulong export_echomail(const char* sub_code, const nodecfg_t* nodecfg, bool resca
cr = 1;
else
cr = 0;
if ((scfg.sub[subnum]->misc & SUB_ASCII)) {
if (scfg.sub[subnum]->misc & SUB_ASCII) {
if (buf[l] < ' ' && buf[l] >= 0 && buf[l] != '\r'
&& buf[l] != '\n') /* Ctrl ascii */
buf[l] = '.'; /* converted to '.' */
......@@ -5211,7 +5211,7 @@ ulong export_echomail(const char* sub_code, const nodecfg_t* nodecfg, bool resca
if (*originline != '\0') {
if (!tear) { /* No previous tear line */
strcat((char *)fmsgbuf, tear_line('-'));
strcat(fmsgbuf, tear_line('-'));
}
if (stricmp(charset, FIDO_CHARSET_ASCII) == 0)
ascii_str(originline);
......@@ -5223,7 +5223,7 @@ ulong export_echomail(const char* sub_code, const nodecfg_t* nodecfg, bool resca
snprintf(str, sizeof str, " * Origin: %s (%s)\r"
, originline
, smb_faddrtoa(&scfg.sub[subnum]->faddr, NULL));
strcat((char *)fmsgbuf, str);
strcat(fmsgbuf, str);
}
for (uint u = 0; u < cfg.areas; u++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment