ioprio.c: use xsprintf instead of sprintf

* ioprio.c: Include "xstring.h".
(sprint_ioprio): Replace sprintf with xsprintf.
This commit is contained in:
Eugene Syromyatnikov 2018-01-05 03:51:19 +01:00 committed by Dmitry V. Levin
parent 0b92a3c933
commit 5f1eafe8e4

View File

@ -27,6 +27,7 @@
*/
#include "defs.h"
#include "xstring.h"
enum {
IOPRIO_WHO_PROCESS = 1,
@ -62,10 +63,10 @@ sprint_ioprio(unsigned int ioprio)
data = IOPRIO_PRIO_DATA(ioprio);
str = xlookup(ioprio_class, class);
if (str)
sprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", str, data);
xsprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", str, data);
else
sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */, %d)",
class, "IOPRIO_CLASS_???", data);
xsprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */, %d)",
class, "IOPRIO_CLASS_???", data);
return outstr;
}