diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 88f96c41a15..739ec40c45c 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2517,6 +2517,20 @@ make_uninit_multibyte_string (EMACS_INT nchars, EMACS_INT nbytes) | |||
| 2517 | return string; | 2517 | return string; |
| 2518 | } | 2518 | } |
| 2519 | 2519 | ||
| 2520 | /* Print arguments to BUF according to a FORMAT, then return | ||
| 2521 | a Lisp_String initialized with the data from BUF. */ | ||
| 2522 | |||
| 2523 | Lisp_Object | ||
| 2524 | make_formatted_string (char *buf, const char *format, ...) | ||
| 2525 | { | ||
| 2526 | va_list ap; | ||
| 2527 | ptrdiff_t length; | ||
| 2528 | |||
| 2529 | va_start (ap, format); | ||
| 2530 | length = vsprintf (buf, format, ap); | ||
| 2531 | va_end (ap); | ||
| 2532 | return make_string (buf, length); | ||
| 2533 | } | ||
| 2520 | 2534 | ||
| 2521 | 2535 | ||
| 2522 | /*********************************************************************** | 2536 | /*********************************************************************** |