[libc-commits] [PATCH] D84469: [libc] Adds implementation for memrchr.
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Jul 23 16:05:19 PDT 2020
lntue added inline comments.
================
Comment at: libc/src/string/memrchr.cpp:18
+ const unsigned char ch = c;
+ while (--n) {
+ if (str[n] == ch)
----------------
I think this will be a trouble if n == 0 because n is unsigned.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84469/new/
https://reviews.llvm.org/D84469
More information about the libc-commits
mailing list