PFORMAT points to a '%' followed by a prefix of a format, all of size PREFIX_LEN. The flags allowed for this format are ALLOWED_FLAGS; remove other printf flags from the prefix, then append SUFFIX. */
| 672 | ALLOWED_FLAGS; remove other printf flags from the prefix, then |
| 673 | append SUFFIX. */ |
| 674 | static void |
| 675 | make_format (char *pformat, size_t prefix_len, char const *allowed_flags, |
| 676 | char const *suffix) |
| 677 | { |
| 678 | char *dst = pformat + 1; |
| 679 | char const *src; |
| 680 | char const *srclim = pformat + prefix_len; |
| 681 | for (src = dst; src < srclim && strchr (printf_flags, *src); src++) |
| 682 | if (strchr (allowed_flags, *src)) |
| 683 | *dst++ = *src; |
| 684 | while (src < srclim) |
| 685 | *dst++ = *src++; |
| 686 | strcpy (dst, suffix); |
| 687 | } |
| 688 | |
| 689 | static void |
| 690 | out_string (char *pformat, size_t prefix_len, char const *arg) |
no outgoing calls
no test coverage detected