This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/1] linux ttyname: return link if appropriate


Quoting Mike Frysinger (vapier@gentoo.org):
> On 15 Apr 2016 18:47, Serge Hallyn wrote:
> > Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
> 
> we don't use s-o-b tags
> 
> > +/*
> > + * Return true if this is a UNIX98 pty device, as defined in
> > + * linux/Documentation/devices.txt
> > + */
> 
> GNU style is:
> 
> /* Return true if this is a UNIX98 pty device, as defined in
>    linux/Documentation/devices.txt.  */
> 
> this applies to comments below too
> 
> > +      if (is_pty (st) && strlen (procname) < buflen - 1)
> > +        {
> > +          memcpy (ttyname_buf, procname, strlen (procname));
> > +          ttyname_buf[strlen (procname)] = '\0';
> 
> since you already verified buflen, why not use strcpy ?

That actually had been my first inclination, not sure why I
switched it.

> also, GNU style says 8 spaces -> 1 tab
> -mike

There were a few other bugs as well.  Replying with a new patch.

thanks,
-serge


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]