diff toys/posix/id.c @ 1518:4bfbd8b96f66 draft

Various bugfixes (mostly resource leaks) from Ashwini Sharma's static analysis, plus occasional tweak by me while reviewing them.
author Rob Landley <rob@landley.net>
date Thu, 09 Oct 2014 13:43:32 -0500
parents 96bdf979d9e6
children 5fac2769a159
line wrap: on
line diff
--- a/toys/posix/id.c	Thu Oct 09 12:17:36 2014 -0500
+++ b/toys/posix/id.c	Thu Oct 09 13:43:32 2014 -0500
@@ -9,7 +9,7 @@
 USE_ID(NEWTOY(id, ">1nGgru[!Ggu]", TOYFLAG_BIN))
 USE_GROUPS(OLDTOY(groups, id, NULL, TOYFLAG_USR|TOYFLAG_BIN))
 USE_LOGNAME(OLDTOY(logname, id, ">0", TOYFLAG_BIN))
-USE_LOGNAME(OLDTOY(whoami, id, ">0", TOYFLAG_BIN))
+USE_WHOAMI(OLDTOY(whoami, id, ">0", TOYFLAG_BIN))
 
 config ID
   bool "id"
@@ -132,7 +132,7 @@
 
 void id_main(void)
 {
-  // FLAG macros can be 0 if "id" command enabled, so snapshot them here.
+  // FLAG macros can be 0 if "id" command not enabled, so snapshot them here.
   if (FLAG_u) TT.do_u = toys.optflags & FLAG_u;
   if (FLAG_n) TT.do_n = toys.optflags & FLAG_n;
   if (FLAG_G) TT.do_G = toys.optflags & FLAG_G;