summaryrefslogtreecommitdiffstats
path: root/libfdisk
diff options
context:
space:
mode:
authorJuerg Haefliger2019-02-22 17:04:12 +0100
committerKarel Zak2019-02-25 14:08:56 +0100
commit834b3d07e498937b729306358683ade395c7df7f (patch)
treee09d93965a2d59737c4e0ba4c1545156df872023 /libfdisk
parentlibfdisk: (dos) rewrite fist/last free sector functions (diff)
downloadkernel-qcow2-util-linux-834b3d07e498937b729306358683ade395c7df7f.tar.gz
kernel-qcow2-util-linux-834b3d07e498937b729306358683ade395c7df7f.tar.xz
kernel-qcow2-util-linux-834b3d07e498937b729306358683ade395c7df7f.zip
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 <juergh@canonical.com>
Diffstat (limited to 'libfdisk')
-rw-r--r--libfdisk/src/dos.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
index fa139a51d..fba953712 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));