libfdisk: (dos) Use strtoul to parse the label-id
PATCH 1/1 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 <[email protected]>
--- libfdisk/src/dos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libfdisk/src/dos.c +1 -1
@@ -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));
Signature · 1 line
2.19.1
Quoted 2 lines · Juerg Haefliger
libfdisk/src/dos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks!
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com