summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/buflib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/buflib.c b/firmware/buflib.c
index d82acd77d3..4ffd6cfce3 100644
--- a/firmware/buflib.c
+++ b/firmware/buflib.c
@@ -628,7 +628,11 @@ buflib_alloc_maximum(struct buflib_context* ctx, const char* name, size_t *size,
628{ 628{
629 /* limit name to 16 since that's what buflib_available() accounts for it */ 629 /* limit name to 16 since that's what buflib_available() accounts for it */
630 char buf[16]; 630 char buf[16];
631
631 *size = buflib_available(ctx); 632 *size = buflib_available(ctx);
633 if (*size <= 0) /* OOM */
634 return -1;
635
632 strlcpy(buf, name, sizeof(buf)); 636 strlcpy(buf, name, sizeof(buf));
633 637
634 return buflib_alloc_ex(ctx, *size, buf, ops); 638 return buflib_alloc_ex(ctx, *size, buf, ops);