diff options
author | Philip Kaludercic <philipk@posteo.net> | 2022-10-15 17:38:30 +0200 |
---|---|---|
committer | Philip Kaludercic <philipk@posteo.net> | 2022-10-15 17:38:30 +0200 |
commit | 01e45efcd44e92dd259283df0e62653c7c20e9cc (patch) | |
tree | 552c1a6ce7d52b897cf5f089d6c589921efbe9bd /src/editfns.c | |
parent | 982c0e6c15535defcf6ac3c4d4169708c60efc18 (diff) | |
parent | 5933055a3e7387b0095f0df7876a208ab15f4f45 (diff) | |
download | emacs-01e45efcd44e92dd259283df0e62653c7c20e9cc.tar.gz emacs-01e45efcd44e92dd259283df0e62653c7c20e9cc.tar.bz2 emacs-01e45efcd44e92dd259283df0e62653c7c20e9cc.zip |
Merge branch 'master' into feature/package+vc
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/editfns.c b/src/editfns.c index c1414071c79..3f9618edb08 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3551,10 +3551,15 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) || float_conversion || conversion == 'i' || conversion == 'o' || conversion == 'x' || conversion == 'X')) - error ("Invalid format operation %%%c", - multibyte_format - ? STRING_CHAR ((unsigned char *) format - 1) - : *((unsigned char *) format - 1)); + { + unsigned char *p = (unsigned char *) format - 1; + if (multibyte_format) + error ("Invalid format operation %%%c", STRING_CHAR (p)); + else + error (*p <= 127 ? "Invalid format operation %%%c" + : "Invalid format operation char #o%03o", + *p); + } else if (! (FIXNUMP (arg) || ((BIGNUMP (arg) || FLOATP (arg)) && conversion != 'c'))) error ("Format specifier doesn't match argument type"); |