summaryrefslogtreecommitdiffstats
path: root/commands/partition.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-08-26 10:58:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2008-08-26 11:40:51 +0200
commit8201d7c5fc46b3355692731f22f0e8631faf51d4 (patch)
tree0444b8caf6fcdb9b5d7c93c893f2d5e12a1abbe5 /commands/partition.c
parentcfdb83790612df60ef523e9dedb26be1708d1157 (diff)
downloadbarebox-8201d7c5fc46b3355692731f22f0e8631faf51d4.tar.gz
barebox-8201d7c5fc46b3355692731f22f0e8631faf51d4.tar.xz
partition: fix compiler warning
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/partition.c')
-rwxr-xr-xcommands/partition.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/commands/partition.c b/commands/partition.c
index 399cb6200..b914d5111 100755
--- a/commands/partition.c
+++ b/commands/partition.c
@@ -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++;
- end = strchr(partstr, ')');
- if (!end) {
+ bclose = strchr(partstr, ')');
+ if (!bclose) {
printf("could not find matching ')'\n");
return -EINVAL;
}
- if (end - partstr >= MAX_DRIVER_NAME) {
+ if (bclose - partstr >= MAX_DRIVER_NAME) {
printf("device name too long\n");
return -EINVAL;
}
- memcpy(part->name, partstr, end - partstr);
- end++;
+ memcpy(part->name, partstr, bclose - partstr);
+ partstr = bclose + 1;
}
- partstr = end;
-
if (*partstr == 'r' && *(partstr + 1) == 'o') {
part->flags |= PARTITION_READONLY;
end = (char *)(partstr + 2);