File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2525set -e
2626set -x
2727
28- CONTAINER=shiftcrypto/firmware_v2:32
28+ CONTAINER=shiftcrypto/firmware_v2:33
2929
3030if [ " $1 " == " pull" ] ; then
3131 docker pull " $CONTAINER "
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ RUN rustup target add thumbv7em-none-eabi
130130RUN rustup component add rustfmt
131131RUN rustup component add clippy
132132RUN CARGO_HOME=/opt/cargo cargo install cbindgen --version 0.24.3
133- RUN CARGO_HOME=/opt/cargo cargo install bindgen-cli --version 0.64.0
133+ RUN CARGO_HOME=/opt/cargo cargo install bindgen-cli --version 0.65.1
134134
135135COPY tools/prost-build-proto prost-build-proto
136136RUN CARGO_HOME=/opt/cargo cargo install --path prost-build-proto --locked
Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ use alloc::vec::Vec;
1818/// Parses a utf-8 string out of a null terminated buffer. Returns `Err(())` if there
1919/// is no null terminator or if the bytes before the null terminator is invalid UTF8.
2020pub fn str_from_null_terminated ( input : & [ u8 ] ) -> Result < & str , ( ) > {
21- let len = input. iter ( ) . position ( |& c| c == 0 ) . ok_or ( ( ) ) ?;
22- core:: str:: from_utf8 ( & input[ 0 ..len] ) . or ( Err ( ( ) ) )
21+ core:: ffi:: CStr :: from_bytes_until_nul ( input)
22+ . or ( Err ( ( ) ) ) ?
23+ . to_str ( )
24+ . or ( Err ( ( ) ) )
2325}
2426
2527/// Parses a utf-8 string out of a null terminated buffer starting at `ptr`. Returns `Err(())` if
Original file line number Diff line number Diff line change 1- 1.68 .0
1+ 1.69 .0
You can’t perform that action at this time.
0 commit comments