home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 125.img / PRO-C4.ZIP / BENCH1.ZIP / BENCH / FCOPY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-28  |  1.1 KB  |  46 lines

  1. /* ==( bench/fcopy.c )== */
  2.  
  3. /* ----------------------------------------------- */
  4. /* Pro-C  Copyright (C) 1988 - 1990 Vestronix Inc. */
  5. /* Modification to this source is not supported    */
  6. /* by Vestronix Inc.                               */
  7. /*            All Rights Reserved                  */
  8. /* ----------------------------------------------- */
  9. /* Written   Nig   1-Jan-87                        */
  10. /* Modified  Geo  11-Dec-89  See comments below    */
  11. /* ----------------------------------------------- */
  12. /* %W%  (%H% %T%) */
  13.  
  14. /*
  15.  *  Modifications
  16.  *
  17.  *  11-Dec-89  Geo - V2 version
  18.  *  25-Oct-89  Geo - 1.32 Merge
  19. */
  20.  
  21. /*
  22.  * This routine is used to copy null terminated strings into a
  23.  * a field of a file record. The destination field is then padded out
  24.  * to a len of DLEN with nulls
  25. */
  26. # include <stdio.h>
  27. # include <bench.h>
  28.  
  29. char *fcopy(dest, src, dlen)
  30. char *dest;
  31. char *src;
  32. int  dlen;
  33. {
  34.    char *p = dest;
  35.  
  36.    if (src != NULL)
  37.        while (*src != '\0' && dest < p + dlen)
  38.           *dest++ = *src++;
  39.  
  40.    while (dest < p + dlen) 
  41.       *dest++ = '\0';
  42.  
  43.    return(dest);
  44. }
  45.  
  46.