]> jfr.im git - solanum.git/commitdiff
strlcat -> rb_strlcat
authorValery Yatsko <redacted>
Sun, 20 Apr 2008 04:44:04 +0000 (08:44 +0400)
committerValery Yatsko <redacted>
Sun, 20 Apr 2008 04:44:04 +0000 (08:44 +0400)
14 files changed:
extensions/ip_cloaking_old.c
extensions/m_identify.c
extensions/m_omode.c
include/irc_string.h
modules/core/m_join.c
modules/m_etrace.c
modules/m_map.c
modules/m_privs.c
modules/m_rehash.c
modules/m_scan.c
src/channel.c
src/irc_string.c
src/s_conf.c
src/supported.c

index 6c186b6aa9528069ccdbe510fb66ce9f3ca977ca..ea2c6bc2ff980a28d814b8f964c7798dd020dfc0 100644 (file)
@@ -102,7 +102,7 @@ do_host_cloak(const char *inbuf, char *outbuf, int ipmask)
                /* try to avoid truncation -- jilles */
                while (len1 + strlen(rest) >= HOSTLEN && (next = strchr(rest + 1, '.')) != NULL)
                        rest = next;
-               strlcat(outbuf, rest, HOSTLEN);
+               rb_strlcat(outbuf, rest, HOSTLEN);
        }
        else
                rb_snprintf(outbuf, HOSTLEN, "%X%X.%s",
index f74921c33aa0e4d351b97d792f03045eadce22e6..76533c2e6c3ea095b96588a421f983e863d5ac05 100644 (file)
@@ -71,8 +71,8 @@ char *reconstruct_parv(int parc, const char *parv[])
        rb_strlcpy(tmpbuf, parv[0], BUFSIZE);
        for (i = 1; i < parc; i++)
        {
-               strlcat(tmpbuf, " ", BUFSIZE);
-               strlcat(tmpbuf, parv[i], BUFSIZE);
+               rb_strlcat(tmpbuf, " ", BUFSIZE);
+               rb_strlcat(tmpbuf, parv[i], BUFSIZE);
        }
        return tmpbuf;
 }
index 3c33f167034d36be0e3f6a786b8ae08157ebadfe..cb2b0d39e6be5567dbb29d25c37c82ba1f4192ad 100644 (file)
@@ -105,8 +105,8 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
        for (i = 2; i < parc; i++)
        {
                if (i != 2)
-                       strlcat(params, " ", sizeof params);
-               strlcat(params, parv[i], sizeof params);
+                       rb_strlcat(params, " ", sizeof params);
+               rb_strlcat(params, parv[i], sizeof params);
        }
 
        sendto_wallops_flags(UMODE_WALLOP, &me, 
index 123c8b6cf6d1544cf4bb9cfed4ab746cd6343d2e..51ea0fd598cdd275eb6b306dfd1357bf92d61045 100644 (file)
@@ -91,10 +91,6 @@ int inetpton(int af, const char *src, void *dst);
 const char *inetntop_sock(struct sockaddr *src, char *dst, unsigned int size);
 int inetpton_sock(const char *src, struct sockaddr *dst);
 
-#ifndef HAVE_STRLCAT
-size_t strlcat(char *dst, const char *src, size_t siz);
-#endif
-
 /*
  * clean_string - cleanup control and high ascii characters
  * -Dianora
index 2d62410123e28f83727c328b02aa724814851a48..f664644029ee96c6b204752c4a74cb7bb67acbb4 100644 (file)
@@ -205,7 +205,7 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p
 
                if(*jbuf)
                        (void) strcat(jbuf, ",");
-               (void) strlcat(jbuf, name, sizeof(jbuf));
+               (void) rb_strlcat(jbuf, name, sizeof(jbuf));
        }
 
        if(parc > 2)
index 92d2ca488fb7112f479d9acc3fbfb1856ed2fd53..9e2998dabf7051965402b328c348e61c787a8704 100644 (file)
@@ -417,8 +417,8 @@ mo_masktrace(struct Client *client_p, struct Client *source_p, int parc,
                        char buf[512];
                        rb_strlcpy(buf, mask, sizeof(buf));
                        if(!EmptyString(gecos)) {
-                               strlcat(buf, " ", sizeof(buf));
-                               strlcat(buf, gecos, sizeof(buf));
+                               rb_strlcat(buf, " ", sizeof(buf));
+                               rb_strlcat(buf, gecos, sizeof(buf));
                        }               
 
                        report_operspy(source_p, "MASKTRACE", buf);     
index d86fe67d43b9332bb3dda948eaf40f82ff610e7c..cbcfad80182295081e0cd6257ea4fa5368ab28cc 100644 (file)
@@ -92,12 +92,12 @@ dump_map(struct Client *client_p, struct Client *root_p, char *pbuf)
        rb_dlink_node *ptr;
        *pbuf = '\0';
 
-       strlcat(pbuf, root_p->name, BUFSIZE);
+       rb_strlcat(pbuf, root_p->name, BUFSIZE);
        if (has_id(root_p))
        {
-               strlcat(pbuf, "[", BUFSIZE);
-               strlcat(pbuf, root_p->id, BUFSIZE);
-               strlcat(pbuf, "]", BUFSIZE);
+               rb_strlcat(pbuf, "[", BUFSIZE);
+               rb_strlcat(pbuf, root_p->id, BUFSIZE);
+               rb_strlcat(pbuf, "]", BUFSIZE);
        }
        len = strlen(buf);
        buf[len] = ' ';
index a11d7b5c3dd208be679f1c75f11a5ae63c6ad569..e4479f6ded8632f9c5641802d0530c52bc4d4294 100644 (file)
@@ -107,17 +107,17 @@ static void show_privs(struct Client *source_p, struct Client *target_p)
                if (target_p->flags2 & p->mode)
                {
                        if (buf[0] != '\0')
-                               strlcat(buf, " ", sizeof buf);
-                       strlcat(buf, p->name, sizeof buf);
+                               rb_strlcat(buf, " ", sizeof buf);
+                       rb_strlcat(buf, p->name, sizeof buf);
                }
                p++;
        }
        if (IsOper(target_p))
        {
                if (buf[0] != '\0')
-                       strlcat(buf, " ", sizeof buf);
-               strlcat(buf, "operator:", sizeof buf);
-               strlcat(buf, target_p->localClient->opername, sizeof buf);
+                       rb_strlcat(buf, " ", sizeof buf);
+               rb_strlcat(buf, "operator:", sizeof buf);
+               rb_strlcat(buf, target_p->localClient->opername, sizeof buf);
        }
        p = &auth_client_table[0];
        while (p->name != NULL)
@@ -125,8 +125,8 @@ static void show_privs(struct Client *source_p, struct Client *target_p)
                if (target_p->flags2 & p->mode)
                {
                        if (buf[0] != '\0')
-                               strlcat(buf, " ", sizeof buf);
-                       strlcat(buf, p->name, sizeof buf);
+                               rb_strlcat(buf, " ", sizeof buf);
+                       rb_strlcat(buf, p->name, sizeof buf);
                }
                p++;
        }
index dc81c43170e09304f3755d3955fa99c1e4f17730..ff0a08a1467bcc8c11806790880ea7047ffd1762 100644 (file)
@@ -285,8 +285,8 @@ do_rehash(struct Client *source_p, const char *type)
                for (x = 0; rehash_commands[x].cmd != NULL && rehash_commands[x].handler != NULL;
                     x++)
                {
-                       strlcat(cmdbuf, " ", sizeof(cmdbuf));
-                       strlcat(cmdbuf, rehash_commands[x].cmd, sizeof(cmdbuf));
+                       rb_strlcat(cmdbuf, " ", sizeof(cmdbuf));
+                       rb_strlcat(cmdbuf, rehash_commands[x].cmd, sizeof(cmdbuf));
                }
                sendto_one_notice(source_p, ":rehash one of:%s", cmdbuf);
        }
index bee5e47b62cd3a38185cddeadc116833a28d00e3..ecb10e9d0062cab61aa9b5bf8861461897608505 100644 (file)
@@ -181,8 +181,8 @@ scan_umodes(struct Client *client_p, struct Client *source_p, int parc,
                                rb_strlcpy(buf, "UMODES", sizeof buf);
                                for (i = 2; i < parc; i++)
                                {
-                                       strlcat(buf, " ", sizeof buf);
-                                       strlcat(buf, parv[i], sizeof buf);
+                                       rb_strlcat(buf, " ", sizeof buf);
+                                       rb_strlcat(buf, parv[i], sizeof buf);
                                }
                                report_operspy(source_p, "SCAN", buf);
                        }
index 1fb8863a0854d9c714edfe5aea7275307b9b89dd..d03744e6dff390a5e6107d645de6fd8a30842ed8 100644 (file)
@@ -1161,7 +1161,7 @@ channel_modes(struct Channel *chptr, struct Client *client_p)
        *mbuf = '\0';
 
        rb_strlcpy(final, buf1, sizeof final);
-       strlcat(final, buf2, sizeof final);
+       rb_strlcat(final, buf2, sizeof final);
        return final;
 }
 
index 4728deb3d3bc50d62bc1ed8c07db3dc60c5c33d8..8fae82a840cf227291c38f39c63094f3f4d81865 100644 (file)
@@ -725,68 +725,6 @@ inetpton(af, src, dst)
        /* NOTREACHED */
 }
 
-/*
- * strlcat and strlcpy were ripped from openssh 2.5.1p2
- * They had the following Copyright info: 
- *
- *
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright    
- *    notice, this list of conditions and the following disclaimer in the  
- *    documentation and/or other materials provided with the distribution. 
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
- * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-
-#ifndef HAVE_STRLCAT
-size_t
-strlcat(char *dst, const char *src, size_t siz)
-{
-       char *d = dst;
-       const char *s = src;
-       size_t n = siz, dlen;
-
-       while(n-- != 0 && *d != '\0')
-               d++;
-       dlen = d - dst;
-       n = siz - dlen;
-
-       if(n == 0)
-               return (dlen + strlen(s));
-       while(*s != '\0')
-       {
-               if(n != 1)
-               {
-                       *d++ = *s;
-                       n--;
-               }
-               s++;
-       }
-       *d = '\0';
-       return (dlen + (s - src));      /* count does not include NUL */
-}
-#endif
-
 char *
 strip_colour(char *string)
 {
index 632d481dd4f71841c55c7d38f49ba35777101a9b..cfa4cb20c589fbe089c12b5305035315805578d1 100644 (file)
@@ -314,7 +314,7 @@ verify_access(struct Client *client_p, const char *username)
        else
        {
                rb_strlcpy(non_ident, "~", sizeof(non_ident));
-               strlcat(non_ident, username, sizeof(non_ident));
+               rb_strlcat(non_ident, username, sizeof(non_ident));
                aconf = find_address_conf(client_p->host, client_p->sockhost,
                                        non_ident, client_p->username,
                                        (struct sockaddr *) &client_p->localClient->ip,
index 001a19201b55787ee921ed9f5e98c86b9e33b2af..b062d55d2c4076922c68dd424243271ad74c40f3 100644 (file)
@@ -162,12 +162,12 @@ show_isupport(struct Client *client_p)
                        nchars = extra_space, nparams = 0, buf[0] = '\0';
                }
                if (nparams > 0)
-                       strlcat(buf, " ", sizeof buf), nchars++;
-               strlcat(buf, item->name, sizeof buf);
+                       rb_strlcat(buf, " ", sizeof buf), nchars++;
+               rb_strlcat(buf, item->name, sizeof buf);
                if (!EmptyString(value))
                {
-                       strlcat(buf, "=", sizeof buf);
-                       strlcat(buf, value, sizeof buf);
+                       rb_strlcat(buf, "=", sizeof buf);
+                       rb_strlcat(buf, value, sizeof buf);
                }
                nchars += l;
                nparams++;