summaryrefslogtreecommitdiff
path: root/source/kit/string_builder.h
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-02-29 00:51:42 +0100
committerMitya Selivanov <automainint@guattari.tech>2024-02-29 00:51:42 +0100
commit2dab66694bb72ee222a44c49c669e9f5adc024f0 (patch)
tree53e89f2cdab40292801da8fe8fb0a511d39377bb /source/kit/string_builder.h
parent0948d02a5a3abae918fa8f5fe1587e19cd0ada41 (diff)
downloadsaw-2dab66694bb72ee222a44c49c669e9f5adc024f0.zip
Load audio file with miniaudio instead of dr_libs; Fix null dereference when loading empty sampler
Diffstat (limited to 'source/kit/string_builder.h')
-rw-r--r--source/kit/string_builder.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/kit/string_builder.h b/source/kit/string_builder.h
index c869afb..23eda65 100644
--- a/source/kit/string_builder.h
+++ b/source/kit/string_builder.h
@@ -56,7 +56,7 @@ static s32 kit_str_append(kit_str_builder_t *a, kit_str_t b) {
i64 n = a->size;
KIT_DA_RESIZE(*a, n + b.size);
if (a->size != n + b.size)
- return KIT_ERROR_BAD_ALLOC;
+ return KIT_ERROR_OUT_OF_MEMORY;
memcpy(a->values + n, b.values, b.size);
return KIT_OK;
}
@@ -71,7 +71,7 @@ static s32 kit_str_insert(kit_str_builder_t *a, i64 index,
i64 n = a->size;
KIT_DA_RESIZE(*a, n + b.size);
if (a->size != n + b.size)
- return KIT_ERROR_BAD_ALLOC;
+ return KIT_ERROR_OUT_OF_MEMORY;
if (index < n)
memmove(a->values + (index + b.size), a->values + index,
n - index);