[PATCH] Fix -Wformat-length warning in tst-setgetname.c

Tolga Dalman tolga.dalman@googlemail.com
Tue Dec 13 00:11:00 GMT 2016


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



More information about the Libc-alpha mailing list