aboutsummaryrefslogtreecommitdiffstats
path: root/rawmemelem.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.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.c')
-rw-r--r--rawmemelem.c8
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;