]> arthur.barton.de Git - ngircd.git/commitdiff
irc-info.c: Use strlcpy() instead of strcpy()
authorAlexander Barton <alex@barton.de>
Sun, 11 Nov 2012 15:46:57 +0000 (16:46 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 11 Nov 2012 15:46:57 +0000 (16:46 +0100)
This fixes the following warning of gcc (tested on OpenBSD 5.0:)
  irc-info.c:990: warning: strcpy() is almost always misused,
                  please use strlcpy

src/ngircd/irc-info.c

index 54f83170e3bceea94828acb1baf83de868a43261..40d4635494a80f74d97737844a633ea651c87edf 100644 (file)
@@ -987,7 +987,7 @@ IRC_WHO_Mask(CLIENT *Client, char *Mask, bool OnlyOps)
                if (IRC_CheckListTooBig(Client, count, MAX_RPL_WHO, "WHO"))
                        break;
 
-               strcpy(flags, who_flags_status(Client_Modes(c)));
+               strlcpy(flags, who_flags_status(Client_Modes(c)), sizeof(flags));
                if (strchr(Client_Modes(c), 'o'))
                        strlcat(flags, "*", sizeof(flags));