ioprio.c: use xsprintf instead of sprintf
* ioprio.c: Include "xstring.h". (sprint_ioprio): Replace sprintf with xsprintf.
This commit is contained in:
parent
0b92a3c933
commit
5f1eafe8e4
7
ioprio.c
7
ioprio.c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user