From 382245c31fb3bad644fcd7d1fe51242304ba594b Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 29 May 2006 02:06:32 +0000 Subject: [PATCH] snprintf size should be at most the size of the buffer From: Luca Berra Signed-off-by: Neil Brown --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index d36feb53..279bfd77 100644 --- a/util.c +++ b/util.c @@ -446,7 +446,7 @@ char *map_dev(int major, int minor, int create) } if (create && !std && !nonstd) { static char buf[30]; - snprintf(buf, 1024, "%d:%d", major, minor); + snprintf(buf, sizeof(buf), "%d:%d", major, minor); nonstd = buf; } -- 2.39.2