summaryrefslogtreecommitdiff
path: root/src/libstddjb/byte_cr.c
blob: d81e7cf54a07b497092c93fafa07f643964f1fa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ISC license. */

#include <skalibs/config.h>

#ifdef SKALIBS_FLAG_REPLACE_LIBC

#include <skalibs/bytestr.h>

void byte_copyr (register char *to, register unsigned int n, register char const *from)
{
  to += n ;
  from += n ;
  for (;;)
  {
    if (!n) return; *--to = *--from; --n;
    if (!n) return; *--to = *--from; --n;
    if (!n) return; *--to = *--from; --n;
    if (!n) return; *--to = *--from; --n;
  }
}

#endif