diff options
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; |