minor coding style: strnstr: added brackets
This commit is contained in:
parent
7ea6692cdb
commit
71b0d509dc
|
@ -337,9 +337,10 @@ strnstr(const char* buffer, const char* token, size_t n)
|
|||
if (tokenlen == 0) {
|
||||
return (char *)buffer;
|
||||
}
|
||||
for (p = buffer; *p && p + tokenlen <= buffer + n; p++) {
|
||||
if (*p == *token && strncmp(p, token, tokenlen) == 0)
|
||||
for (p = buffer; *p && (p + tokenlen <= buffer + n); p++) {
|
||||
if ((*p == *token) && (strncmp(p, token, tokenlen) == 0)) {
|
||||
return (char *)p;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue