On Sun, May 11, 2014 at 08:26:44PM +0100, Sami Kerola wrote: > diff --git a/term-utils/ttymsg.c b/term-utils/ttymsg.c > index fb2614f..3a2565d 100644 > --- a/term-utils/ttymsg.c > +++ b/term-utils/ttymsg.c > @@ -58,6 +58,8 @@ > #include "pathnames.h" > #include "ttymsg.h" > > +enum { ERR_BUFLEN = MAXNAMLEN + 1024 }; Please, don't use enum in this way, just #define ERR_BUFLEN ... > if (strlen(line) + sizeof(_PATH_DEV) + 1 > sizeof(device)) { > sprintf(errbuf, _("excessively long line arg")); > - return (errbuf); > + return errbuf; > } I have fixed the code to use snprintf() everywhere and to check snprintf() return code, that's better than the crazy strlen()+... check. libc is smart enough to help us. > + errbuf[ERR_BUFLEN] = 0; Are you sure? :-) Fixed and merged. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html