aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 0e243f66e..496c81d26 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -13,8 +13,9 @@ typedef struct String {
gb_inline String make_string(u8 *text, isize len) {
String s;
s.text = text;
- if (len < 0)
+ if (len < 0) {
len = gb_strlen(cast(char *)text);
+ }
s.len = len;
return s;
}