aboutsummaryrefslogtreecommitdiff
path: root/lib/memdebug.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-10-25 07:41:11 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-10-25 07:41:11 +0000
commite4a7e18a0c37ce1b3d24ec8511b017ef4391ae49 (patch)
tree55ecbf268d9adfa4cfa2e7e76f3d6835a0637100 /lib/memdebug.c
parent8f5ffd94a2b7b751b95d1abddf936138f3235838 (diff)
compiles on Linux now
Diffstat (limited to 'lib/memdebug.c')
-rw-r--r--lib/memdebug.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/memdebug.c b/lib/memdebug.c
index 5e7d645c6..477ee43cf 100644
--- a/lib/memdebug.c
+++ b/lib/memdebug.c
@@ -54,7 +54,7 @@
* Don't use these with multithreaded test programs!
*/
-FILE *logfile=stderr;
+FILE *logfile;
/* this sets the log file name */
void curl_memdebug(char *logname)
@@ -66,7 +66,7 @@ void curl_memdebug(char *logname)
void *curl_domalloc(size_t size, int line, char *source)
{
void *mem=(malloc)(size);
- fprintf(logfile, "MEM %s:%d malloc(%d) = %p\n",
+ fprintf(logfile?logfile:stderr, "MEM %s:%d malloc(%d) = %p\n",
source, line, size, mem);
return mem;
}
@@ -75,7 +75,7 @@ char *curl_dostrdup(char *str, int line, char *source)
{
char *mem=(strdup)(str);
size_t len=strlen(str)+1;
- fprintf(logfile, "MEM %s:%d strdup(%p) (%d) = %p\n",
+ fprintf(logfile?logfile:stderr, "MEM %s:%d strdup(%p) (%d) = %p\n",
source, line, str, len, mem);
return mem;
}
@@ -83,7 +83,7 @@ char *curl_dostrdup(char *str, int line, char *source)
void *curl_dorealloc(void *ptr, size_t size, int line, char *source)
{
void *mem=(realloc)(ptr, size);
- fprintf(logfile, "MEM %s:%d realloc(%p, %d) = %p\n",
+ fprintf(logfile?logfile:stderr, "MEM %s:%d realloc(%p, %d) = %p\n",
source, line, ptr, size, mem);
return mem;
}
@@ -91,7 +91,7 @@ void *curl_dorealloc(void *ptr, size_t size, int line, char *source)
void curl_dofree(void *ptr, int line, char *source)
{
(free)(ptr);
- fprintf(logfile, "MEM %s:%d free(%p)\n",
+ fprintf(logfile?logfile:stderr, "MEM %s:%d free(%p)\n",
source, line, ptr);
}