From 250898c638f07ace6bc7167faede93113c8fd0db Mon Sep 17 00:00:00 2001 From: frosty Date: Tue, 27 Oct 2026 20:31:28 -0400 Subject: refactor: replace potentially unsafe string functions with snprintf --- src/Infobox/Dictionary.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Infobox/Dictionary.c') diff --git a/src/Infobox/Dictionary.c b/src/Infobox/Dictionary.c index 58d0dfa..4ccabdc 100644 --- a/src/Infobox/Dictionary.c +++ b/src/Infobox/Dictionary.c @@ -207,8 +207,7 @@ char *construct_dictionary_url(const char *query) { const char *base = "https://dictionary.cambridge.org/dictionary/english/"; char *url = malloc(strlen(base) + strlen(escaped) + 1); if (url) { - strcpy(url, base); - strcat(url, escaped); + snprintf(url, strlen(base) + strlen(escaped) + 1, "%s%s", base, escaped); } curl_free(escaped); -- cgit v1.3