...
Code Block | ||
---|---|---|
| ||
static char ok_chars[] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "1234567890_-.@"; char user_data[] = "Bad char 1:} Bad char 2:{"; char *cp; /* cursor into string */ const char *end = user_data + strlen( user_data); for (cp += strspn(cp, userok_datachars); cp != end; cp += strspn(cp, ok_chars)) { *cp = '_'; } |
...