mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: wrap up unsafe { nil } (p. 3)
This commit is contained in:
@@ -33,7 +33,7 @@ pub fn getenv_opt(key string) ?string {
|
||||
return string_from_wide(s)
|
||||
} $else {
|
||||
s := C.getenv(&char(key.str))
|
||||
if s == voidptr(0) {
|
||||
if s == nil {
|
||||
return none
|
||||
}
|
||||
// Note: C.getenv *requires* that the result be copied.
|
||||
|
||||
Reference in New Issue
Block a user