Re:Sentinels Can Be Faster
by burntsushi on Wednesday September 09, 2020 @08:14PM
(#24427520)
Can you double check the code? I just stared at the code snippets for five minutes and couldn't find a single error.
The functions do assume the parameters are non-null pointers to NUL terminated strings, but that kind of assumption is pretty standard in C APIs. So other than that, I don't see any missing NULL check nor do I see the bug you refer to that occurs when there are no leading spaces.
The functions do assume the parameters are non-null pointers to NUL terminated strings, but that kind of assumption is pretty standard in C APIs. So other than that, I don't see any missing NULL check nor do I see the bug you refer to that occurs when there are no leading spaces.