From: Juerg Haefliger Date: Fri, 22 Feb 2019 16:04:12 +0000 (+0100) Subject: libfdisk: (dos) Use strtoul to parse the label-id X-Git-Tag: v2.34-rc1~91 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=834b3d07e498937b729306358683ade395c7df7f;p=thirdparty%2Futil-linux.git libfdisk: (dos) Use strtoul to parse the label-id Parsing of the label-id fails on 32-bit if the MSB is set. Fix that by using strtoul instead of strtol. Signed-off-by: Juerg Haefliger --- diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c index fa139a51d6..fba9537129 100644 --- a/libfdisk/src/dos.c +++ b/libfdisk/src/dos.c @@ -669,7 +669,7 @@ static int dos_create_disklabel(struct fdisk_context *cxt) if (s) { errno = 0; - id = strtol(s, &end, 16); + id = strtoul(s, &end, 16); if (!errno && end && s < end) { has_id = 1; DBG(LABEL, ul_debug("DOS: re-use ID from script (0x%08x)", id));