roken: Fix UB
This commit is contained in:
@@ -449,13 +449,16 @@ xyzprintf (struct snprintf_state *state, const char *char_format, va_list ap)
|
|||||||
break;
|
break;
|
||||||
case 'd' :
|
case 'd' :
|
||||||
case 'i' : {
|
case 'i' : {
|
||||||
longest arg;
|
int64_t arg;
|
||||||
u_longest num;
|
uint64_t num;
|
||||||
int minusp = 0;
|
int minusp = 0;
|
||||||
|
|
||||||
PARSE_INT_FORMAT(arg, ap, signed);
|
PARSE_INT_FORMAT(arg, ap, signed);
|
||||||
|
|
||||||
if (arg < 0) {
|
if (arg == INT64_MIN) {
|
||||||
|
minusp = 1;
|
||||||
|
num = (uint64_t)INT64_MAX + 1;
|
||||||
|
} else if (arg < 0) {
|
||||||
minusp = 1;
|
minusp = 1;
|
||||||
num = -arg;
|
num = -arg;
|
||||||
} else
|
} else
|
||||||
|
Reference in New Issue
Block a user