Fix array-subscript error.

->name is sized to '33' to have room for a trailing nul,
but thhat needs to get put in position '32'.  Doh!
This commit is contained in:
Neil Brown 2006-10-19 16:38:20 +10:00
parent 1cac4c1b55
commit 26a0b8fd7a
1 changed files with 1 additions and 1 deletions

View File

@ -546,7 +546,7 @@ static int update_super1(struct mdinfo *info, void *sbv, char *update,
strncpy(info->name, c+1, 31 - (c-sb->set_name));
else
strncpy(info->name, sb->set_name, 32);
info->name[33] = 0;
info->name[32] = 0;
}
if (strcmp(update, "name") == 0) {
if (info->name[0] == 0)