1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-05-13 15:13:36 +00:00

quotearg: Optimize clearing an mbstate_t.

* lib/quotearg.c: Include <wchar.h>.
(quotearg_buffer_restyled): Use mbszero.
* modules/quotearg (Depends-on): Add mbszero.
This commit is contained in:
Bruno Haible
2023-07-16 07:30:57 +02:00
parent dad9ed27ab
commit a85a9b34bd
3 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
2023-07-16 Bruno Haible <bruno@clisp.org>
quotearg: Optimize clearing an mbstate_t.
* lib/quotearg.c: Include <wchar.h>.
(quotearg_buffer_restyled): Use mbszero.
* modules/quotearg (Depends-on): Add mbszero.
2023-07-16 Bruno Haible <bruno@clisp.org>
vasnprintf, vasnwprintf: Optimize clearing an mbstate_t.

View File

@@ -42,6 +42,7 @@
#include <stdlib.h>
#include <string.h>
#include <uchar.h>
#include <wchar.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@ -607,7 +608,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
else
{
mbstate_t mbstate;
memset (&mbstate, 0, sizeof mbstate);
mbszero (&mbstate);
m = 0;
printable = true;

View File

@@ -13,6 +13,7 @@ c-strcaseeq
c32isprint
extensions
gettext-h
mbszero
mbrtoc32
mbsinit
memcmp