Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
451 B

  1. #include "byte.h"
  2. /* byte_copyr copies in[len-1] to out[len-1], in[len-2] to out[len-2],
  3. * ... and in[0] to out[0] */
  4. void byte_copyr(void* out, unsigned long len, const void* in) {
  5. register char* s=(char*)out+len;
  6. register const char* t=in;
  7. register const char* u=t+len;
  8. for (;;) {
  9. if (t>=u) break; --u; --s; *s=*u;
  10. if (t>=u) break; --u; --s; *s=*u;
  11. if (t>=u) break; --u; --s; *s=*u;
  12. if (t>=u) break; --u; --s; *s=*u;
  13. }
  14. }