summaryrefslogtreecommitdiff
path: root/malloc/memusage.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/memusage.c')
-rw-r--r--malloc/memusage.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/malloc/memusage.c b/malloc/memusage.c
index a57ba8e25a..3bf0b9dd9f 100644
--- a/malloc/memusage.c
+++ b/malloc/memusage.c
@@ -1,5 +1,5 @@
/* Profile heap and stack memory usage of running program.
- Copyright (C) 1998-2015 Free Software Foundation, Inc.
+ Copyright (C) 1998-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -276,9 +276,10 @@ me (void)
/* Determine the buffer size. We use the default if the
environment variable is not present. */
buffer_size = DEFAULT_BUFFER_SIZE;
- if (getenv ("MEMUSAGE_BUFFER_SIZE") != NULL)
+ const char *str_buffer_size = getenv ("MEMUSAGE_BUFFER_SIZE");
+ if (str_buffer_size != NULL)
{
- buffer_size = atoi (getenv ("MEMUSAGE_BUFFER_SIZE"));
+ buffer_size = atoi (str_buffer_size);
if (buffer_size == 0 || buffer_size > DEFAULT_BUFFER_SIZE)
buffer_size = DEFAULT_BUFFER_SIZE;
}