memdebug.h: eliminate global macro CURL_MT_LOGFNAME_BUFSIZE

It had a single use in `src/tool_main.c`. Replace with a literal and
`sizeof()`s.

Follow-up to aaab5fa299
Cherry-picked from #17827
Closes #17833
This commit is contained in:
Viktor Szakats 2025-07-05 11:23:09 +02:00
parent 26f3ee25a4
commit 05263820e5
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 3 additions and 5 deletions

View file

@ -56,8 +56,6 @@
# define ALLOC_SIZE2(n, s)
#endif
#define CURL_MT_LOGFNAME_BUFSIZE 512
/* Avoid redundant redeclaration warnings with modern compilers, when including
this header multiple times. */
#ifndef HEADER_CURL_MEMDEBUG_H_EXTERNS

View file

@ -116,9 +116,9 @@ static void memory_tracking_init(void)
env = curl_getenv("CURL_MEMDEBUG");
if(env) {
/* use the value as filename */
char fname[CURL_MT_LOGFNAME_BUFSIZE];
if(strlen(env) >= CURL_MT_LOGFNAME_BUFSIZE)
env[CURL_MT_LOGFNAME_BUFSIZE-1] = '\0';
char fname[512];
if(strlen(env) >= sizeof(fname))
env[sizeof(fname)-1] = '\0';
strcpy(fname, env);
curl_free(env);
curl_dbg_memdebug(fname);