Changeset ccb739c in rtems


Ignore:
Timestamp:
Mar 19, 2003, 12:51:54 AM (17 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Children:
186d8b2
Parents:
8114f30
Message:

2003-03-18 Ralf Corsepius <corsepiu@…>

  • pppd/utils.c: Remove strlcpy, strlcat.
Location:
c/src/libnetworking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/libnetworking/ChangeLog

    r8114f30 rccb739c  
     12003-03-18      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
     2
     3        * pppd/utils.c: Remove strlcpy, strlcat.
     4
    152003-03-06      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    26
  • c/src/libnetworking/pppd/utils.c

    r8114f30 rccb739c  
    6161    int len;
    6262};
    63 
    64 /*
    65  * strlcpy - like strcpy/strncpy, doesn't overflow destination buffer,
    66  * always leaves destination null-terminated (for len > 0).
    67  */
    68 size_t
    69 strlcpy(dest, src, len)
    70     char *dest;
    71     const char *src;
    72     size_t len;
    73 {
    74     size_t ret = strlen(src);
    75 
    76     if (len != 0) {
    77         if (ret < len)
    78             strcpy(dest, src);
    79         else {
    80             strncpy(dest, src, len - 1);
    81             dest[len-1] = 0;
    82         }
    83     }
    84     return ret;
    85 }
    86 
    87 /*
    88  * strlcat - like strcat/strncat, doesn't overflow destination buffer,
    89  * always leaves destination null-terminated (for len > 0).
    90  */
    91 size_t
    92 strlcat(dest, src, len)
    93     char *dest;
    94     const char *src;
    95     size_t len;
    96 {
    97     size_t dlen = strlen(dest);
    98 
    99     return dlen + strlcpy(dest + dlen, src, (len > dlen? len - dlen: 0));
    100 }
    101 
    10263
    10364/*
Note: See TracChangeset for help on using the changeset viewer.