Closed dxfgg17 closed 1 year ago
Copying string s (which size is n) in buffer of size n+1 always panics because rust expect two slices of same length.
n
n+1
Since buffer has been initialized with 0, no need to add a second instruction like : buffer[s.len()+1] = 0;.
buffer[s.len()+1] = 0;
Sorry for the mistake and thank you for your review. I fixed the issue :)
Merged. Thanks!
Copying string s (which size is
n
) in buffer of sizen+1
always panics because rust expect two slices of same length.Since buffer has been initialized with 0, no need to add a second instruction like :
buffer[s.len()+1] = 0;
.