frank2 / exe-rs

The PE Executable Library, but for Rust!
GNU General Public License v3.0
71 stars 13 forks source link

Intended way to use CChar strings eg Section Name #5

Closed LunNova closed 1 year ago

LunNova commented 1 year ago

What's the intended way to deal with these?

dbg!(section.name.iter().map(|x| x.0 as char).filter(|&x| x > '\0').collect::<String>());

I have this for debug printing but I imagine this isn't the intended way and there's something built in already.

LunNova commented 1 year ago

I missed as_str implemented here: https://github.com/frank2/exe-rs/blob/8dd6acb6539af12e59b9df6791577432606e0279/src/types.rs#L53