]> granicus.if.org Git - strace/commitdiff
ioprio.c: use xsprintf instead of sprintf
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 5 Jan 2018 02:51:19 +0000 (03:51 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 5 Jan 2018 12:26:47 +0000 (12:26 +0000)
* ioprio.c: Include "xstring.h".
(sprint_ioprio): Replace sprintf with xsprintf.

ioprio.c

index 682a7b3b13602ef8f2631e466379776850a918c8..583f022c0fa785a63589e8c195322b9c33e88b04 100644 (file)
--- a/ioprio.c
+++ b/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;
 }