file_systems/userlandfs: Fix -Wnonnull-compare
In String::SetTo(), strnlen() is called only when *str is not NULL. This leads to "-Wnonnull-compare" warning at line 12. So, use system's strnlen() to fix warning. Change-Id: I55098af4e2c62ebcf3b6105b7b8f186eebf28edf Reviewed-on: https://review.haiku-os.org/c/haiku/+/3363 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
064bd70dcf
commit
e497df64de
@ -5,22 +5,6 @@
|
||||
|
||||
#include "String.h"
|
||||
|
||||
// strnlen
|
||||
size_t
|
||||
strnlen(const char *str, size_t maxLen)
|
||||
{
|
||||
if (str) {
|
||||
size_t origMaxLen = maxLen;
|
||||
while (maxLen > 0 && *str != '\0') {
|
||||
maxLen--;
|
||||
str++;
|
||||
}
|
||||
return origMaxLen - maxLen;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\class String
|
||||
\brief A very simple string class.
|
||||
|
Loading…
Reference in New Issue
Block a user