Handle NULL strings

This commit is contained in:
2020-10-08 15:17:53 +01:00
parent 4ac935e478
commit ae61432beb

View File

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