home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / flistfrontend / src / strlcpy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-19  |  745 b   |  40 lines

  1. #ifndef NO_IDENT
  2. static char *Id = "$Id: strlcpy.c,v 1.3 1995/02/19 02:23:25 tom Exp $";
  3. #endif
  4.  
  5. /*
  6.  * Title:    strlcpy.c
  7.  * Author:    Thomas E. Dickey
  8.  * Created:    28 Jun 1984
  9.  * Last update: 15 May 1985, use macro, not routine for convert
  10.  *        28 Jun 1984
  11.  *
  12.  * Function:    Copy a string, converting it to lowercase.
  13.  *
  14.  * Parameters:    optr -    output string pointer
  15.  *         iptr -    input string pointer
  16.  *
  17.  * Returns:    Pointer to final null in output buffer.
  18.  */
  19.  
  20. #include    <ctype.h>
  21.  
  22. #include    "strutils.h"
  23.  
  24. char *
  25. strlcpy (
  26.     char    *optr,            /* => output string        */
  27.     char    *iptr)            /* => input string        */
  28. {
  29.     if (iptr == 0)
  30.         iptr = optr;
  31.  
  32.     while (*iptr)
  33.     {
  34.         *optr++ = _tolower(*iptr);
  35.         iptr++;
  36.     }
  37.     *optr = '\0';            /* Copy a trailing null        */
  38.     return (optr);
  39. }
  40.