mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: use malloc_noscan()
where possible (#10465)
This commit is contained in:
@@ -36,7 +36,7 @@ pub fn parse_rfc2822(s string) ?Time {
|
||||
pos := months_string.index(fields[2]) or { return error('Invalid time format: $s') }
|
||||
mm := pos / 3 + 1
|
||||
unsafe {
|
||||
tmstr := malloc(s.len * 2)
|
||||
tmstr := malloc_noscan(s.len * 2)
|
||||
count := C.snprintf(&char(tmstr), (s.len * 2), c'%s-%02d-%s %s', fields[3].str,
|
||||
mm, fields[1].str, fields[4].str)
|
||||
return parse(tos(tmstr, count))
|
||||
|
Reference in New Issue
Block a user