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 */
| 496 | /* caller is responsible for ensuring that bp is a |
| 497 | valid pointer to a BUFSZ buffer */ |
| 498 | char * |
| 499 | stripchars( |
| 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 */ |
| 520 | char * |
no outgoing calls
no test coverage detected