home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / stex2-18.zip / SeeTeX / Tex3b1 / misc.c < prev    next >
C/C++ Source or Header  |  1990-07-09  |  388b  |  27 lines

  1. /* Berkeley type bcopy, allows for overlapped strings (copies backward). */
  2. bcopy (s,d,n)
  3. char *s, *d;
  4. int n;
  5. {
  6.    register char *from, *to, *base;
  7.  
  8.    base = s;
  9.    from = base + n;
  10.    to = d + n;
  11.    while (from > base)
  12.       *--to = *--from;
  13. }
  14.  
  15. bzero (s,n)
  16. char *s;
  17. int n;
  18. {
  19.    register char *start, *end;
  20.  
  21.    start = s;
  22.    end = start + n;
  23.  
  24.    while (start < end)
  25.       *start++ = 0;
  26. }
  27.