From f9ddb202cad99855fe65358f519869c1db4a9bcd Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Fri, 20 Oct 2023 15:03:34 -0400 Subject: [PATCH] interpreter: fix size_t formatting in string_format --- src/interpreter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interpreter.c b/src/interpreter.c index 61a3f5a..42e39f1 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -54,8 +54,8 @@ string_format(struct context *ctx, struct object *object, arguments->position->values[i]); const char *str_arg = object_to_str(arg); - char needle[8] = {0}; - sprintf(needle, "@%zu@", i); + char needle[32] = {0}; + snprintf(needle, sizeof(needle), "@%zu@", i); const char *found = strstr(fmt, needle); if (!found) { -- 2.45.2