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

Function count_ampersands

src/pinky.c:96–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94/* Count and return the number of ampersands in STR. */
95
96ATTRIBUTE_PURE
97static idx_t
98count_ampersands (char const *str)
99{
100 idx_t count = 0;
101 for (; *str; str++)
102 count += *str == '&';
103 return count;
104}
105
106/* Create a string (via xmalloc) which contains a full name by substituting
107 for each ampersand in GECOS_NAME the USER_NAME string with its first

Callers 1

create_fullnameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected