# HG changeset patch
# User unc0rr
# Date 1542662702 -3600
# Node ID a7320c65f484123b1751acfd8824214f62ab4bdf
# Parent  06f2dc4deab243d463d364e2f831206c23917491
Handle NULL pchar in pchar2astr

diff -r 06f2dc4deab2 -r a7320c65f484 project_files/hwc/rtl/misc.c
--- a/project_files/hwc/rtl/misc.c	Mon Nov 19 21:51:46 2018 +0100
+++ b/project_files/hwc/rtl/misc.c	Mon Nov 19 22:25:02 2018 +0100
@@ -162,6 +162,12 @@
 astring fpcrtl_pchar2astr(const char *s)
 {
     astring result;
+
+    if(!s) {
+        result.len = 0;
+        return result;
+    }
+
     int rlen = strlen(s);
 
     if(rlen > MAX_ANSISTRING_LENGTH){