MCPcopy Create free account
hub / github.com/NetHack/NetHack / stripchars

Function stripchars

src/hacklib.c:498–517  ·  view source on GitHub ↗

strip all the chars in stuff_to_strip from orig */ caller is responsible for ensuring that bp is a valid pointer to a BUFSZ buffer */

Source from the content-addressed store, hash-verified

496/* caller is responsible for ensuring that bp is a
497 valid pointer to a BUFSZ buffer */
498char *
499stripchars(
500 char *bp,
501 const char *stuff_to_strip,
502 const char *orig)
503{
504 int i = 0;
505 char *s = bp;
506
507 while (*orig && i < (BUFSZ - 1)) {
508 if (!strchr(stuff_to_strip, *orig)) {
509 *s++ = *orig;
510 i++;
511 }
512 orig++;
513 }
514 *s = '\0';
515
516 return bp;
517}
518
519/* remove digits from string */
520char *

Callers 2

parse_status_hl2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected