snprintf size should be at most the size of the buffer

From: Luca Berra <bluca@vodka.it>
Signed-off-by: Neil Brown <neilb@suse.de>
This commit is contained in:
Neil Brown 2006-05-29 02:06:32 +00:00
parent 41a3b72a9c
commit 382245c31f
1 changed files with 1 additions and 1 deletions

2
util.c
View File

@ -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;
}