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.33.2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=669b60a0ce66d73e474a4714828377d38f04f45d;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 2e46aca70b..9ed963fb46 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));