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] Fix -Wformat-length warning in tst-setgetname.c


Hi Steve,

nice catch! Your fix is ok -- nitpicking now.

>  #define FMT "/proc/self/task/%lu/comm"
> -  char fname[sizeof (FMT) + 8];
> +  char fname[sizeof (FMT) + 32];

+ 20 is sufficient. (actually 20 - sizeof("%lu"))

>    sprintf (fname, FMT, (unsigned long) tid);

suggest to use snprintf instead.

Thanks
Tolga


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