Advertisement
krtek_net

Untitled

Sep 24th, 2014
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <sys/types.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. static void __attribute__ ((constructor)) strip_env(void);
  6. extern char **environ;
  7.  
  8. static void strip_env()
  9. {
  10. char *p,*c;
  11. int i = 0;
  12. for (p = environ[i]; p!=NULL;i++ ) {
  13. c = strstr(p,"=() {");
  14. if (c != NULL) {
  15. *(c+2) = '\0';
  16. }
  17. p = environ[i];
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement