MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / read_c_string

Function read_c_string

tests/integration/linker.rs:65–73  ·  view source on GitHub ↗
(bytes: &[u8], offset: u32)

Source from the content-addressed store, hash-verified

63}
64
65fn read_c_string(bytes: &[u8], offset: u32) -> String {
66 let start = offset as usize;
67 let end = bytes[start..]
68 .iter()
69 .position(|&b| b == 0)
70 .map(|len| start + len)
71 .unwrap_or(bytes.len());
72 String::from_utf8_lossy(&bytes[start..end]).into_owned()
73}
74
75#[derive(Debug)]
76struct SectionHeader {

Callers 2

parse_sectionsFunction · 0.85
parse_symbolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected