viewing paste Unknown #235 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12
static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString) {
    char *tmpAddress1, *tmpAddress2;
    int result;
 
    if( (tmpAddress1 = strchr(EmailAddress, '<')) && (tmpAddress2 = strchr(tmpAddress1, '>'))  ) {
        *tmpAddress2 = 0; // terminate the string temporarily.
        result = snprintf(Buf, MAIL_BUFFER_SIZE, FormatString , tmpAddress1+1);
        *tmpAddress2 = '>'; // put it back the way it was.
        return result;
    } 
    return snprintf(Buf, MAIL_BUFFER_SIZE , FormatString , EmailAddress );
} /* end FormatEmailAddress() */
Viewed 704 times, submitted by Guest.