MCPcopy Create free account
hub / github.com/NetHack/NetHack / nhl_warn

Function nhl_warn

src/nhlua.c:3007–3025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3005/* called when lua issues a warning message; the text of the message
3006 is passed to us in pieces across multiple function calls */
3007staticfn void
3008nhl_warn(
3009 void *userdata UNUSED,
3010 const char *msg_fragment,
3011 int to_be_continued) /* 0: last fragment; 1: more to come */
3012{
3013 size_t fraglen, buflen = strlen(gl.lua_warnbuf);
3014
3015 if (msg_fragment && buflen < sizeof gl.lua_warnbuf - 1) {
3016 fraglen = strlen(msg_fragment);
3017 if (buflen + fraglen > sizeof gl.lua_warnbuf - 1)
3018 fraglen = sizeof gl.lua_warnbuf - 1 - buflen;
3019 (void) strncat(gl.lua_warnbuf, msg_fragment, fraglen);
3020 }
3021 if (!to_be_continued) {
3022 paniclog("[lua]", gl.lua_warnbuf);
3023 gl.lua_warnbuf[0] = '\0';
3024 }
3025}
3026
3027#ifdef NHL_SANDBOX
3028staticfn void

Callers

nothing calls this directly

Calls 1

paniclogFunction · 0.85

Tested by

no test coverage detected