Ignore:
Timestamp:
Jul 13, 2017, 9:01:05 AM (22 months ago)
Author:
Juanma
Message:

Initial release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • squid-ssl/trunk/fuentes/libltdl/lt__strl.c

    r5495 r5496  
    11/* lt__strl.c -- size-bounded string copying and concatenation
    22
    3    Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
     3   Copyright (C) 2004 Free Software Foundation, Inc.
    44   Written by Bob Friesenhahn, 2004
    55
     
    3737 lt_strlcat appends the NULL-terminated string src to the end of dst.
    3838 It will append at most dstsize - strlen(dst) - 1 bytes,
    39  NULL-terminating the result. The total length of the string that
     39 NULL-terminating the result. The total length of the string which
    4040 would have been created given sufficient buffer size (may be longer
    41  than dstsize) is returned.  This function substitutes for strlcat(),
     41 than dstsize) is returned.  This function substitutes for strlcat()
    4242 which is available under NetBSD, FreeBSD and Solaris 9.
    4343
     
    4747     return -1;
    4848*/
    49 #if !defined HAVE_STRLCAT
     49#if !defined(HAVE_STRLCAT)
    5050size_t
    5151lt_strlcat(char *dst, const char *src, const size_t dstsize)
     
    6666  */
    6767  for ( p = dst + length, q = src;
    68         (*q != 0) && (length < dstsize - 1);
     68        (*q != 0) && (length < dstsize - 1) ;
    6969        length++, p++, q++ )
    7070    *p = *q;
     
    8080  return length;
    8181}
    82 #endif /* !defined HAVE_STRLCAT */
     82#endif /* !defined(HAVE_STRLCAT) */
    8383
    8484/*
    8585  lt_strlcpy copies up to dstsize - 1 characters from the NULL-terminated
    8686  string src to dst, NULL-terminating the result. The total length of
    87   the string that would have been created given sufficient buffer
     87  the string which would have been created given sufficient buffer
    8888  size (may be longer than dstsize) is returned. This function
    89   substitutes for strlcpy(), which is available under OpenBSD, FreeBSD
     89  substitutes for strlcpy() which is available under OpenBSD, FreeBSD
    9090  and Solaris 9.
    9191
     
    9595      return -1;
    9696*/
    97 #if !defined HAVE_STRLCPY
     97#if !defined(HAVE_STRLCPY)
    9898size_t
    9999lt_strlcpy(char *dst, const char *src, const size_t dstsize)
     
    110110    Copy src to dst within bounds of size-1.
    111111  */
    112   for ( p=dst, q=src, length=0;
    113         (*q != 0) && (length < dstsize-1);
     112  for ( p=dst, q=src, length=0 ;
     113        (*q != 0) && (length < dstsize-1) ;
    114114        length++, p++, q++ )
    115115    *p = *q;
     
    125125  return length;
    126126}
    127 #endif /* !defined HAVE_STRLCPY */
     127#endif /* !defined(HAVE_STRLCPY) */
Note: See TracChangeset for help on using the changeset viewer.