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

  1. /* ==( bench/fstrcpy.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 will copy a field to a string and terminate it with
  23.  * a NULL character
  24. */
  25.  
  26. # include <stdio.h>
  27. # include <bench.h>
  28.  
  29. char *fstrcpy(dest, src, slen)
  30. char *dest, *src;
  31. int  slen;
  32. {
  33.    int lslen;
  34.    int i;
  35.    char *ptr = dest;
  36.  
  37.    if (src != NULL)
  38.        for (i = 0, lslen = fstrlen(src, slen); i < lslen; i++)
  39.           *dest++ = *src++;
  40.  
  41.    *dest = '\0';
  42.    return(ptr);
  43. }
  44.  
  45.