Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Unless something weird is going on, argv[0] should be the program name. So doing an atoi will generally produce nothing useful, unless the program's name is 666 or some such.

    That said, it seems a far simpler way to do what the code's doing is to just use sprintf to do the work:

    sprintf(, "%d", argv[0]);

    Which would do nothing -- including not segfault -- if argv[0] isn't numeric.

    Fair warning: it's 4:30 am as I write this, after a bout of insomnia. Use at your own risk. ;-)