aboutsummaryrefslogtreecommitdiffstats
path: root/rawmemelem_inv.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-25 14:17:49 +0100
committerMattias Andrée <maandree@kth.se>2018-11-25 14:17:49 +0100
commite2dc7cf9c966d4c94b7556c1c2ada8d170715654 (patch)
tree78733ab53fb0e1d185773d23f0f5ccd373be2bc1 /rawmemelem_inv.c
parentAdd man pages (diff)
downloadlibsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.gz
libsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.bz2
libsimple-e2dc7cf9c966d4c94b7556c1c2ada8d170715654.tar.xz
Fix consistence in memelem functions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'rawmemelem_inv.c')
-rw-r--r--rawmemelem_inv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rawmemelem_inv.c b/rawmemelem_inv.c
index 0946a48..7046d3c 100644
--- a/rawmemelem_inv.c
+++ b/rawmemelem_inv.c
@@ -4,9 +4,9 @@
void *
-libsimple_rawmemelem_inv(const void *hay_, const void *sub_, size_t subn)
+libsimple_rawmemelem_inv(const void *hay_, const void *sub_, size_t width)
{
- switch (subn) {
+ switch (width) {
case 0:
abort();
case 1:
@@ -37,8 +37,8 @@ libsimple_rawmemelem_inv(const void *hay_, const void *sub_, size_t subn)
char *hay = (void *)hay_;
const char *sub = sub_;
size_t i;
- for (;; hay += subn)
- for (i = 0; i < subn; i++)
+ for (;; hay += width)
+ for (i = 0; i < width; i++)
if (hay[i] != sub[i])
return hay;
}