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