We want len to be the index of the first '\n', or the length of the
string if there is no newline. This is a good example of the
usefulness of strchrnul(). Use that instead, thus eliminating a branch
and a call to strlen().
Signed-off-by: Rasmus Villemoes
---
lib/bitmap.c | 9 ++---
1 file
We want len to be the index of the first '\n', or the length of the
string if there is no newline. This is a good example of the
usefulness of strchrnul(). Use that instead, thus eliminating a branch
and a call to strlen().
Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
2 matches
Mail list logo