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


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 ?

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

Attachment: signature.asc
Description: Digital signature


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