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

Function copynchars

src/hacklib.c:286–297  ·  view source on GitHub ↗

truncating string copy */

Source from the content-addressed store, hash-verified

284
285/* truncating string copy */
286void
287copynchars(char *dst, const char *src, int n)
288{
289 /* copies at most n characters, stopping sooner if terminator reached;
290 treats newline as input terminator; unlike strncpy, always supplies
291 '\0' terminator so dst must be able to hold at least n+1 characters */
292 while (n > 0 && *src != '\0' && *src != '\n') {
293 *dst++ = *src++;
294 --n;
295 }
296 *dst = '\0';
297}
298
299/* convert char nc into oc's case; mostly used by strcasecpy */
300char

Callers 15

NetHackQtYnDialogMethod · 0.85
qt_getlinMethod · 0.85
fruitaddFunction · 0.85
doset_simple_menuFunction · 0.85
submit_web_reportFunction · 0.85
NH_panictrace_libcFunction · 0.85
dump_plinesFunction · 0.85
deliver_by_plineFunction · 0.85
deliver_by_windowFunction · 0.85
worn_item_removalFunction · 0.85
strprependFunction · 0.85
wishymatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected