Why do you need to set argv[0] at all? The correct value is passed to the program by the OS at runtime; you should not need to set it.