Re: [PATCH] procfs: another fix for the process file name in stat/status

2012-09-08 Thread Samuel Thibault
Guillem Jover, le Sun 09 Sep 2012 01:22:43 +0200, a écrit : > On Sun, 2012-09-09 at 00:22:11 +0200, Samuel Thibault wrote: > > Pino Toscano, le Fri 07 Sep 2012 20:02:56 +0200, a écrit : > > > +static int args_filename_length (const char *name) > > > +{ > > > + const char *p = name; > > > + while

Re: [PATCH] procfs: another fix for the process file name in stat/status

2012-09-08 Thread Guillem Jover
On Sun, 2012-09-09 at 00:22:11 +0200, Samuel Thibault wrote: > Pino Toscano, le Fri 07 Sep 2012 20:02:56 +0200, a écrit : > > +static int args_filename_length (const char *name) > > +{ > > + const char *p = name; > > + while (*p != '\0' && *p != ' ') > > +++p; > > Why not using index(name, '

Re: [PATCH] procfs: another fix for the process file name in stat/status

2012-09-08 Thread Samuel Thibault
Pino Toscano, le Fri 07 Sep 2012 20:02:56 +0200, a écrit : > +static int args_filename_length (const char *name) > +{ > + const char *p = name; > + while (*p != '\0' && *p != ' ') > +++p; Why not using index(name, ' ') here? > + return p - name; > +} Samuel