]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: Increase size of percentalert to avoid gcc warning
authorJes Sorensen <jsorensen@fb.com>
Thu, 31 May 2018 15:45:21 +0000 (11:45 -0400)
committerJes Sorensen <jsorensen@fb.com>
Thu, 31 May 2018 15:45:21 +0000 (11:45 -0400)
gcc-8.1 complains about truncated string operations. While we know
percent will never grow larger than 100, it doesn't cost us anything
to increase the size of 'percentalert' on the stack like this.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Monitor.c

index c7c05d27f093b7af6508599118f973f5347bc708..036103fb0f6bd94c2856a8eaed5c88b9e91d28b4 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -557,7 +557,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
                alert("RebuildStarted", dev, NULL, ainfo);
        if (st->percent >= 0 && mse->percent >= 0 &&
            (mse->percent / increments) > (st->percent / increments)) {
-               char percentalert[15];
+               char percentalert[18];
                /*
                 * "RebuildNN" (10 chars) or "RebuildStarted" (15 chars)
                 */