argv[2] is NULL which is why this bit of code comes into play
On the phone Nick: Doctor, can you cure my cough? It is a horrible cough, I cannot sleep at night. Dr. Hell: Sorry, Nick, I cannot prescribe the proper medication without seeing you first, make an appointment for tomorrow. Nick: OK. Next day at Dr Hell's consult. Dr Hell: Who are you? Nick's buddy: I am Nick's best friend. He told me that you needed to see him first, in order for you to prescribe medicine for his cough. So he sent me with his best photograph taken last year at the summer's party.
EvilOrange> there is only 2 var missing and thats:
That's not enough.
EvilOrange> <--Line 27 - proving the scanf("%s", &tmpfilename) is working
Dealing with the format %s in scanf() you must pass the argument as plain tmpfilename or as &tmpfilename[0] , but not as &tmpfilename
EvilOrange> >Cannot open (null) <--Line 30
Are you sure is line 30 and not line 46? fprintf(stderr,"Cannot open %s\n",argv[2]);
EvilOrange> <--Line 27 - proving the scanf("%s", &tmpfilename) is working
Dealing with the format %s in scanf() you must pass the argument as plain tmpfilename or as &tmpfilename[0] , but not as &tmpfilename
EvilOrange> >Cannot open (null) <--Line 30
Are you sure is line 30 and not line 46? fprintf(stderr,"Cannot open %s\n",argv[2]);
bit embarrased now... had code duplication early on, and deleted the wrong snippet which is shown on 46, and you where correct about the cannot open (null)
it is a sunday and i shouldn't be working after all, thanks.
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.