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

Function search_bytes

src/cut.c:432–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430/* Like memchr, but avoid a function call for smaller amounts. */
431
432static inline void*
433search_bytes (char const *buf, int c, size_t n_bytes)
434{
435 if (n_bytes != 0 && to_uchar (buf[0]) == c)
436 return (char *) buf;
437 if (1 < n_bytes && to_uchar (buf[1]) == c)
438 return (char *) buf + 1;
439
440 return 2 < n_bytes ? (char *) memchr (buf + 2, c, n_bytes - 2) : NULL;
441}
442
443static inline void
444write_line_delim (void)

Callers 1

cut_bytesFunction · 0.85

Calls 1

to_ucharFunction · 0.85

Tested by

no test coverage detected