MCPcopy Create free account
hub / github.com/coreutils/coreutils / make_format

Function make_format

src/stat.c:674–687  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

672 ALLOWED_FLAGS; remove other printf flags from the prefix, then
673 append SUFFIX. */
674static void
675make_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
689static void
690out_string (char *pformat, size_t prefix_len, char const *arg)

Callers 6

out_stringFunction · 0.85
out_intFunction · 0.85
out_uintFunction · 0.85
out_uint_oFunction · 0.85
out_uint_xFunction · 0.85
out_minus_zeroFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected