File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -231,16 +231,16 @@ fn test_symlink() {
231
231
let expected_path = path. as_os_str ( ) . as_bytes ( ) ;
232
232
233
233
// Test that the expected string gets written to a buffer of proper
234
- // length, and that a trailing null byte is not written
234
+ // length, and that a trailing null byte is not written.
235
235
let symlink_c_str = CString :: new ( symlink_path. as_os_str ( ) . as_bytes ( ) ) . unwrap ( ) ;
236
236
let symlink_c_ptr = symlink_c_str. as_ptr ( ) ;
237
237
238
238
// Make the buf one byte larger than it needs to be,
239
- // and check that the last byte is not overwritten
239
+ // and check that the last byte is not overwritten.
240
240
let mut large_buf = vec ! [ 0xFF ; expected_path. len( ) + 1 ] ;
241
241
let res = unsafe { libc:: readlink ( symlink_c_ptr, large_buf. as_mut_ptr ( ) . cast ( ) , large_buf. len ( ) ) } ;
242
242
assert_eq ! ( res, large_buf. len( ) as isize - 1 ) ;
243
- // Check that the resovled path was properly written into the buf
243
+ // Check that the resovled path was properly written into the buf.
244
244
assert_eq ! ( & large_buf[ ..( large_buf. len( ) - 1 ) ] , expected_path) ;
245
245
assert_eq ! ( large_buf. last( ) , Some ( & 0xFF ) ) ;
246
246
You can’t perform that action at this time.
0 commit comments