--- a/fdisk.c
+++ b/fdisk.c
@@ -82,9 +82,9 @@
 
 	/* 0x is hex, 0 is octal, everything else is decimal. */
 	if (strncmp(s, "0x", 2) == 0 || strncmp(s, "0X", 2) == 0)
-		sscanf(s + 2, "%x", &n);
+		sscanf(s + 2, "%x", (unsigned int *) &n);
 	else if (s[0] == '0' && s[1])
-		sscanf(s + 1, "%o", &n);
+		sscanf(s + 1, "%o", (unsigned int *) &n);
 	else {
 		d=s;
 		while (d[0]!=0) {
