diff options
-rwxr-xr-x | lib/core/typeinfo.nim | 3 | ||||
-rwxr-xr-x | lib/pure/times.nim | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/core/typeinfo.nim b/lib/core/typeinfo.nim index 9cc8e4dfd..ca2b68cc3 100755 --- a/lib/core/typeinfo.nim +++ b/lib/core/typeinfo.nim @@ -479,7 +479,8 @@ proc setBiggestFloat*(x: TAny, y: biggestFloat) = proc getString*(x: TAny): string = ## retrieve the string value out of `x`. `x` needs to represent a string. assert x.rawtype.kind == tyString - result = cast[ptr string](x.value)[] + if not isNil(cast[ptr pointer](x.value)[]): + result = cast[ptr string](x.value)[] proc setString*(x: TAny, y: string) = ## sets the string value of `x`. `x` needs to represent a string. diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 327dc9187..2070a39d8 100755 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -26,8 +26,8 @@ type dMon, dTue, dWed, dThu, dFri, dSat, dSun var - timezone* {.importc, header: "<time.h>".}: int - tzname* {.importc, header: "<time.h>" .}: array[0..1, cstring] + timezone {.importc, header: "<time.h>".}: int + tzname {.importc, header: "<time.h>" .}: array[0..1, cstring] when defined(posix): type |