home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Misc / c / strcpycr < prev    next >
Encoding:
Text File  |  1993-05-17  |  981 b   |  32 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Misc.strcpycr.c
  12.     Author:  Copyright © 1993 Jason Williams
  13.     Version: 1.00 (16 May 1993)
  14.     Purpose: Copies a CR-terminated string - note that this will change the
  15.              terminator of the result to a NUL (0).
  16. */
  17.  
  18.  
  19. extern char *strcpycr(char *s1, char *s2)
  20. {
  21.   register int index = 0;
  22.  
  23.   while (s2[index] > 31)
  24.   {
  25.     s1[index]  = s2[index];
  26.     index++;
  27.   }
  28.  
  29.   s1[index] = 0;
  30.   return(s1);
  31. }
  32.