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

Function strprepend

src/objnam.c:122–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120};
121
122staticfn char *
123strprepend(char *s, const char *pref)
124{
125 char star_s = *s;
126 int i = (int) strlen(pref);
127
128 if (i > PREFIX) {
129 impossible("PREFIX too short (for %d).", i);
130 return s;
131 }
132 copynchars(s - i, pref, i + 1);
133 *s = star_s;
134 return s - i;
135}
136
137/* manage a pool of BUFSZ buffers, so callers don't have to */
138static char NEARDATA obufs[NUMOBUF][BUFSZ];

Callers 4

mshot_xnameFunction · 0.85
doname_baseFunction · 0.85
aobjnamFunction · 0.85
paydonameFunction · 0.85

Calls 2

copyncharsFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected