]> arthur.barton.de Git - ngircd-alex.git/commitdiff
ngircd.c, main(): use strlcat() instead of strcat()
authorAlexander Barton <alex@barton.de>
Mon, 7 Oct 2013 19:56:09 +0000 (21:56 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 7 Oct 2013 19:56:09 +0000 (21:56 +0200)
This fixes the following warning on OpenBSD 5.3:

 ngircd.o(.text+0xeb4): In function `main':
  src/ngircd/ngircd.c:300: warning: strcat() is almost always misused,
                                    please use strlcat()

Thanks to Götz Hoffart for reporting this!

src/ngircd/ngircd.c

index 5637cb2578666c91ef0a9945231fc2b74686d97c..9c2740976a10d59c1baba7c1201a490b445b50fd 100644 (file)
@@ -297,7 +297,7 @@ main(int argc, const char *argv[])
                         PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION,
                         IRCPLUSFLAGS);
 #ifdef ZLIB
-               strcat(NGIRCd_ProtoID, "Z");
+               strlcat(NGIRCd_ProtoID, "Z", sizeof NGIRCd_ProtoID);
 #endif
                if (Conf_OperCanMode)
                        strcat(NGIRCd_ProtoID, "o");