diff options
| author | Paul Eggert | 2015-11-24 23:43:43 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-11-24 23:44:10 -0800 |
| commit | d8143fa89b60943ac569c02f2a6d4738a217df88 (patch) | |
| tree | 39002dfb06caf879a055b2c6bf69dc5cfdfcb862 /src | |
| parent | 36311ec8d12f88e5ad0a6a5ff845b0b307f4ea13 (diff) | |
| download | emacs-d8143fa89b60943ac569c02f2a6d4738a217df88.tar.gz emacs-d8143fa89b60943ac569c02f2a6d4738a217df88.zip | |
Fix module_format_fun_env when dynlib_addr fails
* src/emacs-module.c (module_format_fun_env):
exprintf doesn’t support %p, so use %x. Reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg02122.html
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs-module.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index 11aefc31359..1388e5348bb 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -1035,15 +1035,15 @@ module_format_fun_env (const struct module_fun_env *env) | |||
| 1035 | { | 1035 | { |
| 1036 | /* Try to print a function name if possible. */ | 1036 | /* Try to print a function name if possible. */ |
| 1037 | const char *path, *sym; | 1037 | const char *path, *sym; |
| 1038 | char buffer[256]; | 1038 | static char const noaddr_format[] = "#<module function at %p>"; |
| 1039 | char buffer[sizeof noaddr_format + INT_STRLEN_BOUND (intptr_t) + 256]; | ||
| 1039 | char *buf = buffer; | 1040 | char *buf = buffer; |
| 1040 | ptrdiff_t bufsize = sizeof buffer; | 1041 | ptrdiff_t bufsize = sizeof buffer; |
| 1041 | ptrdiff_t size | 1042 | ptrdiff_t size |
| 1042 | = (dynlib_addr (env->subr, &path, &sym) | 1043 | = (dynlib_addr (env->subr, &path, &sym) |
| 1043 | ? exprintf (&buf, &bufsize, buffer, -1, | 1044 | ? exprintf (&buf, &bufsize, buffer, -1, |
| 1044 | "#<module function %s from %s>", sym, path) | 1045 | "#<module function %s from %s>", sym, path) |
| 1045 | : exprintf (&buf, &bufsize, buffer, -1, | 1046 | : sprintf (buffer, noaddr_format, env->subr)); |
| 1046 | "#<module function at %p>", env->subr)); | ||
| 1047 | Lisp_Object unibyte_result = make_unibyte_string (buffer, size); | 1047 | Lisp_Object unibyte_result = make_unibyte_string (buffer, size); |
| 1048 | if (buf != buffer) | 1048 | if (buf != buffer) |
| 1049 | xfree (buf); | 1049 | xfree (buf); |