about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--stdlib/getenv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/getenv.c b/stdlib/getenv.c
index 57a8b6f013..b38b332ff8 100644
--- a/stdlib/getenv.c
+++ b/stdlib/getenv.c
@@ -32,7 +32,6 @@
 char *
 getenv (const char *name)
 {
-  size_t len = strlen (name);
   char **ep;
   uint16_t name_start;
 
@@ -63,6 +62,7 @@ getenv (const char *name)
     }
   else
     {
+      size_t len = strlen (name);
 #if _STRING_ARCH_unaligned
       name_start = *(const uint16_t *) name;
 #else