C
cerr
Hi,
I'm writing an FTP xclient and in order to receive data, I need to figure out contents of the "PASV" reply, so I came up with following:
....
....
printf ("MESSAGE FROM SERVER (PASV):\n%s\n", replyBuf);
// calculate port number
if(pch = strchr(replyBuf,')') != NULL) { //find end of response string
strend = pch - replyBuf;
printf("end of resp str: %d\n",strend);
....
....
and for some reason I get this result:
MESSAGE FROM SERVER (PASV):
227 Entering Passive Mode (3,94,213,53,84,75).
!ü·P%í¤%í@%îðà!?"iÔÌ"ià
%í£À
end of resp str: -636416131
Why would that be? strchr() "returns a pointer to the first occurrence of character in the C string str." - so where am I going wrong here?
Thank you!
Ron
I'm writing an FTP xclient and in order to receive data, I need to figure out contents of the "PASV" reply, so I came up with following:
....
....
printf ("MESSAGE FROM SERVER (PASV):\n%s\n", replyBuf);
// calculate port number
if(pch = strchr(replyBuf,')') != NULL) { //find end of response string
strend = pch - replyBuf;
printf("end of resp str: %d\n",strend);
....
....
and for some reason I get this result:
MESSAGE FROM SERVER (PASV):
227 Entering Passive Mode (3,94,213,53,84,75).
!ü·P%í¤%í@%îðà!?"iÔÌ"ià
%í£À
end of resp str: -636416131
Why would that be? strchr() "returns a pointer to the first occurrence of character in the C string str." - so where am I going wrong here?
Thank you!
Ron