From e245a66054cac00f2916fbc9436d926ea2cf4d1c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 10 Oct 2006 22:57:07 +0000 Subject: * src/ls.c (quote_name): Use initializer rather than memset to initialize an object to zero. This is easier to read and is less likely to introduce an runtime error due to a mixup. It causes gcc -W to issue a warning, but you can work around this by appending -Wno-missing-field-initializers. * src/pathchk.c (portable_chars_only): Likewise. * src/shred.c (main): Likewise. * src/stty.c (main): Likewise. * src/tr.c (card_of_complement): Likewise. * src/wc.c (wc): Likewise. --- src/pathchk.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/pathchk.c') diff --git a/src/pathchk.c b/src/pathchk.c index 04b46d8a8..2fc55d346 100644 --- a/src/pathchk.c +++ b/src/pathchk.c @@ -200,11 +200,8 @@ portable_chars_only (char const *file, size_t filelen) if (*invalid) { - mbstate_t mbstate; - size_t charlen; - - memset (&mbstate, 0, sizeof mbstate); - charlen = mbrlen (invalid, filelen - validlen, &mbstate); + mbstate_t mbstate = { 0, }; + size_t charlen = mbrlen (invalid, filelen - validlen, &mbstate); error (0, 0, _("nonportable character %s in file name %s"), quotearg_n_style_mem (1, locale_quoting_style, invalid, -- cgit v1.2.3-54-g00ecf