changeset 1248:407357afa07f

Bugfix: if $TERM and friends aren't set, putenv() got passed a NULL.
author Rob Landley <rob@landley.net>
date Wed, 09 Apr 2014 09:23:17 -0500
parents d630b3be752f
children b13728c24a58
files toys/lsb/su.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/toys/lsb/su.c	Wed Apr 09 08:30:09 2014 -0500
+++ b/toys/lsb/su.c	Wed Apr 09 09:23:17 2014 -0500
@@ -71,7 +71,7 @@
       snapshot_env("COLORTERM"), snapshot_env("XAUTHORITY")};
 
     clearenv();
-    for (i=0; i < sizeof(stuff)/sizeof(char *); i++) putenv(stuff[i]);
+    for (i=0; i < ARRAY_LEN(stuff); i++) if (stuff[i]) putenv(stuff[i]);
     *(argv++) = "-l";
     xchdir(up->pw_dir);
   } else unsetenv("IFS");