diff toys/lsb/su.c @ 1248:407357afa07f draft

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 0752b2d58909
children 685a0da6ca59
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");