Guest User

Untitled

a guest
Apr 26th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. char *PathEnv;
  2. char *Tokd;
  3. char *Tmp;
  4. const char *Final;
  5. std::cout << "NULL" << std::endl;
  6. PathEnv=getenv((const char *) "PATH");
  7. std::cout << PathEnv << std::endl << strlen(PathEnv) << std::endl;
  8. Tokd=strtok(PathEnv, (const char*)":");
  9. while(Tokd != NULL) {
  10. // char *WotGoesBoom= new char[(strlen(PathEnv) + 1) * sizeof(char)];
  11. char WotGoesBoom[8192];
  12. strcat(WotGoesBoom, Tokd);
  13. strcat(WotGoesBoom, (char*)"/");
  14. strcat(WotGoesBoom, Engine::ArgZero);
  15. std::cout << Tokd << std::endl;
  16. std::cout << WotGoesBoom << std::endl;
  17. if(Engine::fExists(WotGoesBoom)) {
  18. Tmp=WotGoesBoom;
  19. for(int i=0; i<8192; i+=1) {
  20. WotGoesBoom[i]=0;
  21. }
  22. }
  23. Tokd=strtok(NULL, (const char*)":");
  24. // delete WotGoesBoom;
  25. }
  26. Final=Tmp;
  27. return Final;
Add Comment
Please, Sign In to add comment