diff options
| author | frosty <frostinator33@airmail.cc> | 2026-10-27 20:31:28 -0400 |
|---|---|---|
| committer | frosty <frostinator33@airmail.cc> | 2026-10-27 20:33:50 -0400 |
| commit | 250898c638f07ace6bc7167faede93113c8fd0db (patch) | |
| tree | 310addbedcaaf76da98df22434a4f4711c8ba963 /src/Infobox/Dictionary.c | |
| parent | bd3da2232540ea4c78e7ac35e2c90c38c8a3c410 (diff) | |
refactor: replace potentially unsafe string functions with snprintf
Diffstat (limited to 'src/Infobox/Dictionary.c')
| -rw-r--r-- | src/Infobox/Dictionary.c | 3 |
1 files changed, 1 insertions, 2 deletions
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); |
