Re: [PATCH 01/10] logger: ensure program writes everything to syslog file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 29, 2014 at 09:52:50AM +0200, Karel Zak wrote:
> On Tue, Jul 22, 2014 at 11:00:50PM +0100, Sami Kerola wrote:
> > @@ -281,8 +282,8 @@ static void mysyslog(int fd, int logflags, int pri, char *tag, char *msg)
> >                 snprintf(buf, sizeof(buf), "<%d>%.15s %.200s%s: %.400s",
>                   ^^^^^^^^^^
> >  			pri, tp, cp, pid, msg);
> >  
> > +	       if (write_all(fd, buf, strlen(buf)+1) < 0)
>                                   ^^^^^^^^^^
> > +		       warn(_("write failed"));
> 
>  Do we really need strlen() if there is snprintf(buf, ....)?

 I'm going to improve this, you don't have send a new version.

    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




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux