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

Function nmcpy

src/options.c:6860–6871  ·  view source on GitHub ↗

copy up to maxlen-1 characters; 'dest' must be able to hold maxlen; treat comma as alternate end of 'src' */

Source from the content-addressed store, hash-verified

6858/* copy up to maxlen-1 characters; 'dest' must be able to hold maxlen;
6859 treat comma as alternate end of 'src' */
6860staticfn void
6861nmcpy(char *dest, const char *src, int maxlen)
6862{
6863 int count;
6864
6865 for (count = 1; count < maxlen; count++) {
6866 if (*src == ',' || *src == '\0')
6867 break; /*exit on \0 terminator*/
6868 *dest++ = *src++;
6869 }
6870 *dest = '\0';
6871}
6872
6873/*
6874 * escapes(): escape expansion for showsyms. C-style escapes understood

Callers 8

petname_optfnFunction · 0.85
optfn_fruitFunction · 0.85
optfn_nameFunction · 0.85
optfn_roleFunction · 0.85
optfn_windowchainFunction · 0.85
optfn_windowtypeFunction · 0.85
initoptions_initFunction · 0.85
fruitaddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected