Modify the buffer replacing all occurrences of chars from the 'from' * set with the corresponding char in the 'to' set. Always returns s. */
| 260 | * set with the corresponding char in the 'to' set. Always returns s. |
| 261 | */ |
| 262 | char *memmapchars(char *s, size_t len, const char *from, const char *to, size_t setlen) { |
| 263 | for (size_t j = 0; j < len; j++) { |
| 264 | for (size_t i = 0; i < setlen; i++) { |
| 265 | if (s[j] == from[i]) { |
| 266 | s[j] = to[i]; |
| 267 | break; |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | return s; |
| 272 | } |
| 273 | |
| 274 | /* Return the number of digits of 'v' when converted to string in radix 10. |
| 275 | * See ll2string() for more information. */ |