Skip to content

Commit f1b2489

Browse files
committed
Fix null check in load_string
1 parent 78f6771 commit f1b2489

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stringdtype/stringdtype/src/static_string.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ static ss EMPTY = {0, "\0"};
6767
void
6868
load_string(char *data, ss **out)
6969
{
70-
if (data == NULL) {
70+
ss *ss_d = (ss *)data;
71+
if (ss_d->len == 0) {
7172
*out = ∅
7273
}
7374
else {
74-
*out = (ss *)data;
75+
*out = ss_d;
7576
}
7677
}

0 commit comments

Comments
 (0)