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

Function testinglog

src/files.c:2835–2854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2833}
2834
2835void
2836testinglog(const char *filenm, /* ad hoc file name */
2837 const char *type,
2838 const char *reason) /* explanation */
2839{
2840 FILE *lfile;
2841 char fnbuf[BUFSZ];
2842
2843 if (!filenm)
2844 return;
2845 Strcpy(fnbuf, filenm);
2846 if (strchr(fnbuf, '.') == 0)
2847 Strcat(fnbuf, ".log");
2848 lfile = fopen_datafile(fnbuf, "a", TROUBLEPREFIX);
2849 if (lfile) {
2850 (void) fprintf(lfile, "%s\n%s\n", type, reason);
2851 (void) fclose(lfile);
2852 }
2853 return;
2854}
2855
2856/* ---------- END PANIC/IMPOSSIBLE/TESTING LOG ----------- */
2857

Callers

nothing calls this directly

Calls 3

fprintfFunction · 0.85
fcloseFunction · 0.85
fopen_datafileFunction · 0.70

Tested by

no test coverage detected