Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Solved] SMTP Problems

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
nwongfeiying
Grandmaster Cheater
Reputation: 2

Joined: 25 Jun 2007
Posts: 695

PostPosted: Wed Sep 22, 2010 7:30 pm    Post subject: [Solved] SMTP Problems Reply with quote

Don't worry about it Smile

Last edited by nwongfeiying on Wed Sep 22, 2010 9:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 891

PostPosted: Wed Sep 22, 2010 7:51 pm    Post subject: Reply with quote

Does your trim function chomp the newline?
Back to top
View user's profile Send private message
nwongfeiying
Grandmaster Cheater
Reputation: 2

Joined: 25 Jun 2007
Posts: 695

PostPosted: Wed Sep 22, 2010 8:06 pm    Post subject: Reply with quote

justa_dude wrote:
Does your trim function chomp the newline?


Code:
char * fnFormatAddress(char * argv)
{
   char * pchArgv = argv;

   if (!argv)
      return NULL;   // NULL string
   else if (!*argv)
      return argv;   // empty string

   for(pchArgv = argv + strlen(argv) - 1; pchArgv >= argv && isspace(* pchArgv); --pchArgv)
      pchArgv[1] = '\0';

   return argv;
}


That is my function for that. I don't believe it removes the newline but I don't think there is a newline.


Last edited by nwongfeiying on Wed Sep 22, 2010 8:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 891

PostPosted: Wed Sep 22, 2010 8:28 pm    Post subject: Reply with quote

No offense, but that's some of the fugliest code I've seen in a long time.

fgets includes a newline, and isspace returns true on newlines. However, your for loop breaks on the first space character from the end of a string. A newline might be a cr/lf combo. The user input might also have multiple trailing spaces.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites