aboutsummaryrefslogtreecommitdiffstats
path: root/memends.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-06-11 16:37:09 +0200
committerMattias Andrée <maandree@kth.se>2022-06-11 16:37:09 +0200
commitfcfe59c1f2219408ac2a9cd84b386816ff252221 (patch)
tree0f46c009babfba2d0200ece3ecce067c548a66b6 /memends.c
parentRemove `static` from some `static inline` (diff)
downloadlibsimple-fcfe59c1f2219408ac2a9cd84b386816ff252221.tar.gz
libsimple-fcfe59c1f2219408ac2a9cd84b386816ff252221.tar.bz2
libsimple-fcfe59c1f2219408ac2a9cd84b386816ff252221.tar.xz
Fix warnings, replace some static inline with inline + extern inline, and fix glibc support
Diffstat (limited to 'memends.c')
-rw-r--r--memends.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/memends.c b/memends.c
index f579222..be4b1d4 100644
--- a/memends.c
+++ b/memends.c
@@ -9,9 +9,12 @@ libsimple_memends(const void *s_, size_t n, const void *t_, size_t m)
const char *s = s_, *t = t_;
if (n < m)
return 0;
- while (n--, m--)
+ while (m) {
+ n--;
+ m--;
if (s[n] != t[m])
return 0;
+ }
return 1;
}