minor coding style: strnstr: added brackets

This commit is contained in:
goldsimon 2010-03-22 15:48:23 +00:00
parent 7ea6692cdb
commit 71b0d509dc
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}