Handle NULL strings
This commit is contained in:
1 parent
4ac935e478
commit
ae61432beb
1 file changed
+5
@@ -190,6 +190,11 @@ int strbld_str(str_builder *sb, const char *str, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (str == 0) {
|
||||
// NOTE: Should this be a fail?
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
len = strlen(str);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user