diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/editfns.c b/src/editfns.c index ee538e50e25..fd9fbaeaea2 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3477,8 +3477,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 3477 | error ("Format specifier doesn't match argument type"); | 3477 | error ("Format specifier doesn't match argument type"); |
| 3478 | else | 3478 | else |
| 3479 | { | 3479 | { |
| 3480 | /* Length of pM (that is, of pMd without the trailing "d"). */ | 3480 | /* Length of PRIdMAX without the trailing "d". */ |
| 3481 | enum { pMlen = sizeof pMd - 2 }; | 3481 | enum { pMlen = sizeof PRIdMAX - 2 }; |
| 3482 | 3482 | ||
| 3483 | /* Avoid undefined behavior in underlying sprintf. */ | 3483 | /* Avoid undefined behavior in underlying sprintf. */ |
| 3484 | if (conversion == 'd' || conversion == 'i') | 3484 | if (conversion == 'd' || conversion == 'i') |
| @@ -3487,7 +3487,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 3487 | /* Create the copy of the conversion specification, with | 3487 | /* Create the copy of the conversion specification, with |
| 3488 | any width and precision removed, with ".*" inserted, | 3488 | any width and precision removed, with ".*" inserted, |
| 3489 | with "L" possibly inserted for floating-point formats, | 3489 | with "L" possibly inserted for floating-point formats, |
| 3490 | and with pM inserted for integer formats. | 3490 | and with PRIdMAX (sans "d") inserted for integer formats. |
| 3491 | At most two flags F can be specified at once. */ | 3491 | At most two flags F can be specified at once. */ |
| 3492 | char convspec[sizeof "%FF.*d" + max (sizeof "L" - 1, pMlen)]; | 3492 | char convspec[sizeof "%FF.*d" + max (sizeof "L" - 1, pMlen)]; |
| 3493 | char *f = convspec; | 3493 | char *f = convspec; |
| @@ -3616,7 +3616,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 3616 | { | 3616 | { |
| 3617 | if (FIXNUMP (arg)) | 3617 | if (FIXNUMP (arg)) |
| 3618 | { | 3618 | { |
| 3619 | printmax_t x = XFIXNUM (arg); | 3619 | intmax_t x = XFIXNUM (arg); |
| 3620 | sprintf_bytes = sprintf (p, convspec, prec, x); | 3620 | sprintf_bytes = sprintf (p, convspec, prec, x); |
| 3621 | } | 3621 | } |
| 3622 | else | 3622 | else |
| @@ -3636,7 +3636,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 3636 | } | 3636 | } |
| 3637 | else | 3637 | else |
| 3638 | { | 3638 | { |
| 3639 | uprintmax_t x; | 3639 | uintmax_t x; |
| 3640 | bool negative; | 3640 | bool negative; |
| 3641 | if (FIXNUMP (arg)) | 3641 | if (FIXNUMP (arg)) |
| 3642 | { | 3642 | { |
| @@ -3655,8 +3655,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 3655 | else | 3655 | else |
| 3656 | { | 3656 | { |
| 3657 | double d = XFLOAT_DATA (arg); | 3657 | double d = XFLOAT_DATA (arg); |
| 3658 | double uprintmax = TYPE_MAXIMUM (uprintmax_t); | 3658 | double uintmax = UINTMAX_MAX; |
| 3659 | if (! (0 <= d && d < uprintmax + 1)) | 3659 | if (! (0 <= d && d < uintmax + 1)) |
| 3660 | xsignal1 (Qoverflow_error, arg); | 3660 | xsignal1 (Qoverflow_error, arg); |
| 3661 | x = d; | 3661 | x = d; |
| 3662 | negative = false; | 3662 | negative = false; |