Messages in this thread | | | Subject | Re: Changing argv[0] under Linux. | From | Valdis.Kletnieks@vt ... | Date | Tue, 14 Jan 2003 17:04:05 -0500 |
| |
On Tue, 14 Jan 2003 21:55:02 GMT, Miquel van Smoorenburg <miquels@cistron.nl> said:
> If you want to modify argv[0] etc, loop over argv[], count howmuch > space there is (strlen(argv[0] + 1 + strlen(argv[1] + 1 ... etc) > and make sure you do NOT write a string longer than that. Also > make sure that you end the string with a double \0
Or steal the code that's already been done - sendmail and wu-ftpd both have code to do this....
-- Valdis Kletnieks Computer Systems Senior Engineer Virginia Tech
[unhandled content-type:application/pgp-signature] | |