mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: warn if C.m* or C.s* functions are called outside unsafe blocks (#5869)
This commit is contained in:
@@ -32,11 +32,15 @@ pub fn setenv(name string, value string, overwrite bool) int {
|
||||
$if windows {
|
||||
format := '$name=$value'
|
||||
if overwrite {
|
||||
return C._putenv(format.str)
|
||||
unsafe {
|
||||
return C._putenv(format.str)
|
||||
}
|
||||
}
|
||||
return -1
|
||||
} $else {
|
||||
return C.setenv(charptr(name.str), charptr(value.str), overwrite)
|
||||
unsafe {
|
||||
return C.setenv(charptr(name.str), charptr(value.str), overwrite)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user