1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: warn when casting a fixed array (use &arr[0] instead) (#8787)

This commit is contained in:
Nick Treleaven
2021-02-17 19:45:11 +00:00
committed by GitHub
parent 177c8bfc78
commit 4ccf991f61
7 changed files with 19 additions and 17 deletions

View File

@ -34,8 +34,7 @@ pub fn (mut con TcpConn) read_line() string {
break
}
}
bufbp := byteptr(buf)
line = unsafe { tos_clone(bufbp) }
line = unsafe { tos_clone(&buf[0]) }
if eol_idx > 0 {
// At this point, we are sure that recv returned valid data,
// that contains *at least* one line.