Phillip Johnston

Results 80 comments of Phillip Johnston

In strtok: ``` spanp = (char*)(uintptr_t)delim; ```

strstr is guilty: ``` return (char*)(uintptr_t)string; ``` (two places)

__memrchr: ``` return (void*)(uintptr_t)(s + n); ```

strtol ``` *endptr = (char*)(uintptr_t)(any ? s - 1 : nptr); *endptr = (char*)(uintptr_t)nptr; ``` and others

memmem... ``` return (void*)(uintptr_t)cur; ```

bsearch: ``` return ((void*)(uintptr_t)p); ```

strtoll: ``` *endptr = (char*)(uintptr_t)(any ? s - 1 : nptr); *endptr = (char*)(uintptr_t)nptr; ```

strtoull: ``` *endptr = (char*)(uintptr_t)(any ? s - 1 : nptr); ```

Just referring to the standard libc. I'd like to provide safe equivalents for these functions which don't cast. The unsafe variants (standard implementation) can then call the safe variants and...