diff --git a/src/db_value.c b/src/db_value.c index feb6c1a..a76bd33 100644 --- a/src/db_value.c +++ b/src/db_value.c @@ -52,10 +52,17 @@ void db_value_sbva(str_builder *sb, e_column_type type, uint32_t n_args, va_list int nchar; if (n_args == 0) { + if (type == TYPE_RAW) { + strbld_str(sb, "NULL", 4); + } return; } if (type == TYPE_RAW) { + if (n_args == 0) { + strbld_str(sb, "NULL", 4); + return; + } tmp_str = va_arg(args, char *); tmp_len = va_arg(args, size_t); strbld_str(sb, tmp_str, tmp_len);