aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-17 22:42:09 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-17 22:42:09 +0100
commit2d6171f3e573c06dc9eb1c8fc3ada720998b24fa (patch)
treefbbb53577d440765f2ea536e5c086f40b092823d /src/string.cpp
parent67694c0df07c758effbc7dcb10c76a2b2bffe5d0 (diff)
#import search rule: relative then core/
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;
}