read_simplemail() when SERVER_ADMIN_MSG is defined
Some warnings were mentioned Add a prototype ahead of the function Use a non-const copy of SERVER_ADMIN_MSG quick-tested by: - uncommenting the following in include/unixconf.h /* #define SERVER_ADMIN_MSG "adminmsg" */ - building NetHack - creating a test message: echo "server_admin: system is going down at 2 pm" >~/nh/install/games/lib/nethackdir/adminmsg - playtested and received the desired message
This commit is contained in:
@@ -1221,12 +1221,12 @@ strbuf_nl_to_crlf(strbuf_t *strbuf)
|
||||
}
|
||||
|
||||
char *
|
||||
nonconst(const char *str, char *buf)
|
||||
nonconst(const char *str, char *buf, size_t bufsz)
|
||||
{
|
||||
char *retval = emptystr;
|
||||
|
||||
if (str && buf)
|
||||
if ((int) strlen(str) < BUFSZ - 1) {
|
||||
if (strlen(str) < (bufsz - 1)) {
|
||||
Strcpy(buf, str);
|
||||
retval = buf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user