2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

[master] Add isc_buffer_printf()

4767.	[func]		Add a new function, isc_buffer_printf(), which can be
			used to append a formatted string to the used region of
			a buffer. [RT #46201]
This commit is contained in:
Michał Kępień
2017-10-09 11:43:07 +02:00
parent c0f78692ee
commit 077f9626c2
7 changed files with 207 additions and 45 deletions

View File

@@ -1036,12 +1036,7 @@ named_os_shutdownmsg(char *command, isc_buffer_t *text) {
pid = getpid();
#endif
n = snprintf((char *)isc_buffer_used(text),
isc_buffer_availablelength(text),
"pid: %ld", (long)pid);
/* Only send a message if it is complete. */
if (n > 0 && n < isc_buffer_availablelength(text))
isc_buffer_add(text, n);
(void)isc_buffer_printf(text, "pid: %ld", (long)pid);
}
void