]> Savannah Git Hosting - gnulib.git/commit
xvasprintf: Guarantee a non-NULL result.
authorBruno Haible <bruno@clisp.org>
Sat, 22 Jun 2024 10:17:51 +0000 (12:17 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 22 Jun 2024 10:17:51 +0000 (12:17 +0200)
commit53549b9b9198f1309f9559cf377e344cf5ea784c
tree0e9aceedaf33916331558ca849e2111f11f18a5f
parent134cfb88c06b0a427f3b4c60acb664c9cc5ec2d9
xvasprintf: Guarantee a non-NULL result.

* lib/xvasprintf.h: Clarify the programmer's responsibilities.
(xasprintf, xvasprintf): Declare as returning non-NULL.
* lib/xvasprintf.c: Include <stdlib.h>.
(xstrcat): Allow results longer than INT_MAX characters. Upon size
overflow, invoke xalloc_die.
(xvasprintf): Call vazsprintf instead of vasprintf. When some other
error occurs, emit an error message and abort.
* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): New macro, extracted
from gl_FUNC_STRERRORNAME_NP.
(gl_FUNC_STRERRORNAME_NP): Invoke it.
(gl_OPTIONAL_STRERRORNAME_NP): New macro.
* m4/xvasprintf.m4 (gl_XVASPRINTF): Invoke gl_OPTIONAL_STRERRORNAME_NP.
* modules/xvasprintf (Files): Add m4/strerrorname_np.m4.
(Depends-on): Add extensions, vazsprintf. Remove vasprintf.
* NEWS: Mention the change.
ChangeLog
NEWS
lib/xvasprintf.c
lib/xvasprintf.h
m4/strerrorname_np.m4
m4/xvasprintf.m4
modules/xvasprintf