--- 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;
}