super-intel: Avoid gcc-8.1 complaining about truncating snprintf()

We know the max size of the volume name, so no need to play the
snprintf() game.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Jes Sorensen 2018-05-30 11:56:37 -04:00
parent 1cdc06dfda
commit 40659392ff
1 changed files with 2 additions and 1 deletions

View File

@ -9881,6 +9881,7 @@ static void imsm_process_update(struct supertype *st,
/* sanity check that we are not affecting the uuid of
* an active array
*/
memset(name, 0, sizeof(name));
snprintf(name, MAX_RAID_SERIAL_LEN, "%s", (char *) u->name);
name[MAX_RAID_SERIAL_LEN] = '\0';
for (a = st->arrays; a; a = a->next)
@ -9892,7 +9893,7 @@ static void imsm_process_update(struct supertype *st,
break;
}
snprintf((char *) dev->volume, MAX_RAID_SERIAL_LEN, "%s", name);
memcpy(dev->volume, name, MAX_RAID_SERIAL_LEN);
super->updates_pending++;
break;
}