From b75f886706e92d51db63b86299a7069a08bda269 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 6 Jan 2018 01:45:16 +0000 Subject: [PATCH] open.c: use xsnprintf instead of sprintf * open.c: Include "xstring.h". (sprint_open_modes): Replace sprintf with xsnprintf. --- open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/open.c b/open.c index 28222666..ab9e8ef7 100644 --- a/open.c +++ b/open.c @@ -34,6 +34,7 @@ */ #include "defs.h" +#include "xstring.h" #include @@ -110,7 +111,7 @@ sprint_open_modes(unsigned int flags) } /* flags is still nonzero */ *p++ = sep; - sprintf(p, "%#x", flags); + xsnprintf(p, sizeof(outstr) - (p - outstr), "%#x", flags); return outstr; } -- 2.40.0