mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-29 05:17:57 +00:00
Change printf formats to not assume longs and ints are the same size
This commit is contained in:
parent
ba1f12de85
commit
b8b8bc8e37
10
confpars.c
10
confpars.c
@ -1530,15 +1530,15 @@ void convert_num (buf, str, base, size)
|
||||
if (val > max) {
|
||||
switch (base) {
|
||||
case 8:
|
||||
warn ("value %s%lo exceeds max (%d) for precision.",
|
||||
warn ("value %s%o exceeds max (%d) for precision.",
|
||||
negative ? "-" : "", val, max);
|
||||
break;
|
||||
case 16:
|
||||
warn ("value %s%lx exceeds max (%d) for precision.",
|
||||
warn ("value %s%x exceeds max (%d) for precision.",
|
||||
negative ? "-" : "", val, max);
|
||||
break;
|
||||
default:
|
||||
warn ("value %s%ld exceeds max (%d) for precision.",
|
||||
warn ("value %s%u exceeds max (%d) for precision.",
|
||||
negative ? "-" : "", val, max);
|
||||
break;
|
||||
}
|
||||
@ -1556,7 +1556,7 @@ void convert_num (buf, str, base, size)
|
||||
putLong (buf, -(unsigned long)val);
|
||||
break;
|
||||
default:
|
||||
warn ("Unexpected integer size: %d\n");
|
||||
warn ("Unexpected integer size: %d\n", size);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -1571,7 +1571,7 @@ void convert_num (buf, str, base, size)
|
||||
putULong (buf, val);
|
||||
break;
|
||||
default:
|
||||
warn ("Unexpected integer size: %d\n");
|
||||
warn ("Unexpected integer size: %d\n", size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1530,15 +1530,15 @@ void convert_num (buf, str, base, size)
|
||||
if (val > max) {
|
||||
switch (base) {
|
||||
case 8:
|
||||
warn ("value %s%lo exceeds max (%d) for precision.",
|
||||
warn ("value %s%o exceeds max (%d) for precision.",
|
||||
negative ? "-" : "", val, max);
|
||||
break;
|
||||
case 16:
|
||||
warn ("value %s%lx exceeds max (%d) for precision.",
|
||||
warn ("value %s%x exceeds max (%d) for precision.",
|
||||
negative ? "-" : "", val, max);
|
||||
break;
|
||||
default:
|
||||
warn ("value %s%ld exceeds max (%d) for precision.",
|
||||
warn ("value %s%u exceeds max (%d) for precision.",
|
||||
negative ? "-" : "", val, max);
|
||||
break;
|
||||
}
|
||||
@ -1556,7 +1556,7 @@ void convert_num (buf, str, base, size)
|
||||
putLong (buf, -(unsigned long)val);
|
||||
break;
|
||||
default:
|
||||
warn ("Unexpected integer size: %d\n");
|
||||
warn ("Unexpected integer size: %d\n", size);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -1571,7 +1571,7 @@ void convert_num (buf, str, base, size)
|
||||
putULong (buf, val);
|
||||
break;
|
||||
default:
|
||||
warn ("Unexpected integer size: %d\n");
|
||||
warn ("Unexpected integer size: %d\n", size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user