I am working on a mail environment which requires me to retrieve mails from a POP3 server. For everyone unfamiliar with how the POP works:
You issue CRLF-terminated commands and retrieve answers of unknown physical lengh containing ASCII chars terminated by a CRLF.CRLF
If I now want to work on parts of that retrieve message - say extract information from the mail header - I'd have to use string-dependent functions - like strstr() or some regexing stuff. But, as I mentioned before, the answer may contain every ASCII char - even the '\0'/NULL character.
Hence, how would you propose I should handle this data? Is there a string function which doesn't depend on the NULL-byte rather than on a given length? Or do I have to write some code which will iterate through all the chars of the answer, replace every NULL-byte with a sequence of my choice and later replace that replacement char again so the integrity isn't destroyed?
Sloede