MCPcopy Index your code
hub / github.com/NetHack/NetHack / vraw_printf

Function vraw_printf

src/pline.c:562–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560DISABLE_WARNING_FORMAT_NONLITERAL
561
562staticfn void
563vraw_printf(const char *line, va_list the_args)
564{
565 char pbuf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
566
567 if (strchr(line, '%')) {
568 (void) vsnprintf(pbuf, sizeof(pbuf), line, the_args);
569 line = pbuf;
570 }
571 if ((int) strlen(line) > BUFSZ - 1) {
572 if (line != pbuf)
573 line = strncpy(pbuf, line, BUFSZ - 1);
574 /* unlike pline, we don't futz around to keep last few chars */
575 pbuf[BUFSZ - 1] = '\0'; /* terminate strncpy or truncate vsprintf */
576 }
577 raw_print(line);
578 execplinehandler(line);
579 if (!program_state.beyond_savefile_load)
580 ge.early_raw_messages++;
581}
582
583void
584impossible(const char *s, ...)

Callers 1

raw_printfFunction · 0.85

Calls 2

raw_printFunction · 0.85
execplinehandlerFunction · 0.85

Tested by

no test coverage detected