Optimization I'd like to see compilers be able to make: if (strlen(s)>100) -> if (strnlen(s,101)>100)
Related issue: What if there is not a single zero byte in memory? What is the expected behavior of strlen(s)>100 in this case? If it has to never return then it isn't equivalent to strnlen(s, 101)>100.
-
-
strlen is only defined when the parameter points to a zero-terminated string. If there's no zero byte in memory, you don't have a string, and calling strlen invokes undefined behavior.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.