project_files/hwc/rtl/misc.c
changeset 14251 fa2e3f123a09
parent 14250 a7320c65f484
child 14256 73d514c0bdf5
--- a/project_files/hwc/rtl/misc.c	Mon Nov 19 22:25:02 2018 +0100
+++ b/project_files/hwc/rtl/misc.c	Mon Nov 19 22:26:47 2018 +0100
@@ -163,20 +163,21 @@
 {
     astring result;
 
-    if(!s) {
+    if(!s) 
+    {
         result.len = 0;
-        return result;
-    }
-
-    int rlen = strlen(s);
+    } else
+    {
+        int rlen = strlen(s);
 
-    if(rlen > MAX_ANSISTRING_LENGTH){
-        rlen = MAX_ANSISTRING_LENGTH;
+        if(rlen > MAX_ANSISTRING_LENGTH){
+            rlen = MAX_ANSISTRING_LENGTH;
+        }
+
+        result.len = rlen;
+        memcpy(result.str, s, rlen);
     }
 
-    result.len = rlen;
-    memcpy(result.s + 1, s, rlen);
-
     return result;
 }