Dr. Dobb's Journal Fall 1998
int strlen (char *ptr) {
int i = 0;
if (ptr == NULL) {
/* the real strlen doesn't handle this */
/* case, but I do! I return -1 */
return (-1);
}
while (*ptr++) != '\0') {
i++;
}
return i;
}