MCPcopy Create free account
hub / github.com/F-Stack/f-stack / trim_space

Function trim_space

dpdk/app/test-bbdev/test_bbdev_vector.c:29–49  ·  view source on GitHub ↗

trim leading and trailing spaces */

Source from the content-addressed store, hash-verified

27
28/* trim leading and trailing spaces */
29static void
30trim_space(char *str)
31{
32 char *start, *end;
33
34 for (start = str; *start; start++) {
35 if (!isspace((unsigned char) start[0]))
36 break;
37 }
38
39 for (end = start + strlen(start); end > start + 1; end--) {
40 if (!isspace((unsigned char) end[-1]))
41 break;
42 }
43
44 *end = 0;
45
46 /* Shift from "start" to the beginning of the string */
47 if (start > str)
48 memmove(str, start, (end - start) + 1);
49}
50
51static bool
52starts_with(const char *str, const char *pre)

Callers 5

parse_turbo_flagsFunction · 0.70
op_turbo_type_strtolFunction · 0.70
parse_expected_statusFunction · 0.70
parse_entryFunction · 0.70
test_bbdev_vector_readFunction · 0.70

Calls 2

isspaceFunction · 0.85
memmoveFunction · 0.50

Tested by

no test coverage detected