MCPcopy Create free account
hub / github.com/crossuo/crossuo / read_string

Function read_string

external/tracy/libbacktrace/dwarf.cpp:791–806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789/* Read one zero-terminated string from BUF and advance past the string. */
790
791static const char *
792read_string (struct dwarf_buf *buf)
793{
794 const char *p = (const char *)buf->buf;
795 size_t len = strnlen (p, buf->left);
796
797 /* - If len == left, we ran out of buffer before finding the zero terminator.
798 Generate an error by advancing len + 1.
799 - If len < left, advance by len + 1 to skip past the zero terminator. */
800 size_t count = len + 1;
801
802 if (!advance (buf, count))
803 return NULL;
804
805 return p;
806}
807
808/* Read one byte from BUF and advance 1 byte. */
809

Callers 3

read_attributeFunction · 0.70
read_v2_pathsFunction · 0.70
read_line_programFunction · 0.70

Calls 2

advanceFunction · 0.85
strnlenFunction · 0.50

Tested by

no test coverage detected