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.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds