Use const char * for read_simplemail 'mbox' param

Nothing about read_simplemail is incompatible with using const, and the
lack of const required some contortions (copying ADMIN_SERVER_MSG to
another buffer with nonconst() to prevent a compiler warning).

This was the last place nonconst() was used, so I removed it.
This commit is contained in:
Michael Meyer
2022-08-31 21:42:02 -04:00
committed by Pasi Kallinen
parent b18d768b26
commit 51d568319b
3 changed files with 3 additions and 20 deletions

View File

@@ -74,7 +74,6 @@
void strbuf_reserve (strbuf *, int)
void strbuf_empty (strbuf *)
void strbuf_nl_to_crlf (strbuf_t *)
char * nonconst (const char *, char *)
int swapbits (int, int, int)
void shuffle_int_array (int *, int)
void nh_snprintf (const char *, int, char *, size_t,
@@ -1271,19 +1270,6 @@ strbuf_nl_to_crlf(strbuf_t *strbuf)
}
}
char *
nonconst(const char *str, char *buf, size_t bufsz)
{
char *retval = emptystr;
if (str && buf)
if (strlen(str) <= (bufsz - 1)) {
Strcpy(buf, str);
retval = buf;
}
return retval;
}
/* swapbits(val, bita, bitb) swaps bit a with bit b in val */
int
swapbits(int val, int bita, int bitb)