]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
snprintf size should be at most the size of the buffer
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index d36feb539ef867f9af84784f813d516128446022..279bfd77287c69b121667165f8608fa7a09fa1e9 100644 (file)
--- 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;
        }