diff options
Diffstat (limited to 'mempsetelem.c')
-rw-r--r-- | mempsetelem.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mempsetelem.c b/mempsetelem.c index d431604..c8990ed 100644 --- a/mempsetelem.c +++ b/mempsetelem.c @@ -4,7 +4,7 @@ void * -libsimple_mempsetelem(void *buf_, const void *item, size_t size, size_t nitems) +libsimple_mempsetelem(void *buf_, const void *item, size_t size, size_t nitems) /* TODO test */ { switch (size) { case 0: @@ -38,8 +38,10 @@ libsimple_mempsetelem(void *buf_, const void *item, size_t size, size_t nitems) default: { char *buf = buf_; + size_t i; for (; nitems--; buf += size) - memcpy(buf, item, size); + for (i = 0; i < size; i++) + buf[i] = ((const char *)item)[i]; return buf; } } |