The sad tale of qmail
Posted Aug 31, 2006 16:53 UTC (Thu) by
RussNelson (guest, #27730)
In reply to:
The sad tale of qmail by cventers
Parent article:
A comparison of Mail Transfer Agents - Part One
Actually, I've gotten quite used to djbc. His library is more sublime than the standard C library. For example, stdC's strchr returns a pointer to the character or a null pointer. This leads to crappy coding like this:
*strchr(ptr,';') = '\0'; /* this string always has a semicolon; */
whereas djbc's str_chr returns an offset from the beginning of the array ALWAYS. If the character has not been found, the offset is to the null character. So this is guaranteed to always work:
ptr[str_chr(ptr,';')] = '\0';
His functions for dynamic string lengths are so easy to use that I've come to hate coding in stdC without them. They eliminate the half of all security problems caused by buffer overruns.
(
Log in to post comments)