aboutsummaryrefslogtreecommitdiff
path: root/lib/progress.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-05-29 23:07:22 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-05-29 23:07:22 +0000
commit6d522c9c1dae070f73aae1022b09b68f9153959e (patch)
treee8d3b26169fb00fff416efd01a353a5b079e908a /lib/progress.c
parent45885f30c2753c66cff34f2e80ac26dcc8cfae75 (diff)
made getenv() more threadsafe for win32
Diffstat (limited to 'lib/progress.c')
-rw-r--r--lib/progress.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 35847fab4..b2372aa53 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -387,6 +387,7 @@ void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
/* 20000318 mgs */
int scr_size [2];
#endif
+ char *colp;
if(data->conf&(CONF_NOPROGRESS|CONF_MUTE))
return;
@@ -399,8 +400,11 @@ void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
/* 20000318 mgs
* OS/2 users most likely won't have this env var set, and besides that
* we're using our own way to determine screen width */
- if (curl_GetEnv("COLUMNS") != NULL)
- width = atoi(curl_GetEnv("COLUMNS"));
+ colp = curl_GetEnv("COLUMNS");
+ if (colp != NULL) {
+ width = atoi(colp);
+ free(colp);
+ }
else
width = 79;
#else