diff options
author | Mattias Andrée <maandree@kth.se> | 2018-11-25 14:17:49 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-11-25 14:17:49 +0100 |
commit | e2dc7cf9c966d4c94b7556c1c2ada8d170715654 (patch) | |
tree | 78733ab53fb0e1d185773d23f0f5ccd373be2bc1 /rawmemelem.c | |
parent | Add man pages (diff) | |
download | libsimple-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.c')
-rw-r--r-- | rawmemelem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rawmemelem.c b/rawmemelem.c index d2d743a..fa67a51 100644 --- a/rawmemelem.c +++ b/rawmemelem.c @@ -4,9 +4,9 @@ void * -libsimple_rawmemelem(const void *hay_, const void *sub_, size_t subn) +libsimple_rawmemelem(const void *hay_, const void *sub_, size_t width) { - switch (subn) { + switch (width) { case 0: return (void *)hay_; case 1: @@ -37,8 +37,8 @@ libsimple_rawmemelem(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]) goto next; return hay; |