9
0
Fork 0

Revert "partition: fix compiler warning"

Grumpf. Better compiler warnings than broken code :(

This reverts commit 8201d7c5fc.
This commit is contained in:
Sascha Hauer 2008-08-27 18:10:18 +02:00
parent 3d3d4a6c3b
commit 60fb727353
1 changed files with 7 additions and 7 deletions

View File

@ -133,23 +133,23 @@ static int mtd_part_do_parse_one(struct partition *part, const char *partstr,
partstr = end;
if (*partstr == '(') {
const char *bclose;
partstr++;
bclose = strchr(partstr, ')');
if (!bclose) {
end = strchr(partstr, ')');
if (!end) {
printf("could not find matching ')'\n");
return -EINVAL;
}
if (bclose - partstr >= MAX_DRIVER_NAME) {
if (end - partstr >= MAX_DRIVER_NAME) {
printf("device name too long\n");
return -EINVAL;
}
memcpy(part->name, partstr, bclose - partstr);
partstr = bclose + 1;
memcpy(part->name, partstr, end - partstr);
end++;
}
partstr = end;
if (*partstr == 'r' && *(partstr + 1) == 'o') {
part->flags |= PARTITION_READONLY;
end = (char *)(partstr + 2);