Shane Hathaway wrote:
Dave Smith wrote:
int main( int argc, char **argv )
{
    if( argc != 2 )
    {
        printf( "Usage: %s <path>\n", argv[0] );
        return 1;
    }

    char output[PATH_MAX];
    realpath( argv[1], output );
    printf( "%s\n", output );

    return 0;
}

Didn't your mother teach you to check error codes?  Your hard drive
might spontaneously combust during the realpath() call, yet this program
will happily print garbage and say it was miraculously successful anyway.

Did you forget to attach your patch? I can't seem to find it in your last email.

--Dave

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to