summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-10-09 11:56:40 +0000
committerJim Meyering <jim@meyering.net>2006-10-09 11:56:40 +0000
commit6089facdc39bc6e3d92a0e5f8f3e201b405dabae (patch)
tree059ea330192e872a3eaa9707c49398680f6de44e
parent181428d65335d463a03c34d7f620131819f4f187 (diff)
downloadcoreutils-6089facdc39bc6e3d92a0e5f8f3e201b405dabae.tar.xz
Avoid a compiler warning.
* src/pathchk.c (portable_chars_only): Initialize variable of type mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible.
-rw-r--r--ChangeLog6
-rw-r--r--src/pathchk.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 44002bd79..0660bc067 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-09 Jim Meyering <jim@meyering.net>
+
+ Avoid a compiler warning.
+ * src/pathchk.c (portable_chars_only): Initialize variable of type
+ mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible.
+
2006-10-06 Paul Eggert <eggert@cs.ucla.edu>
Fix bug reported today by Mike Frysinger: mkdir -pv is logging the
diff --git a/src/pathchk.c b/src/pathchk.c
index e4c0f448f..04b46d8a8 100644
--- a/src/pathchk.c
+++ b/src/pathchk.c
@@ -1,5 +1,5 @@
/* pathchk -- check whether file names are valid or portable
- Copyright (C) 1991-2005 Free Software Foundation, Inc.
+ Copyright (C) 1991-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -200,8 +200,11 @@ portable_chars_only (char const *file, size_t filelen)
if (*invalid)
{
- mbstate_t mbstate = {0};
- size_t charlen = mbrlen (invalid, filelen - validlen, &mbstate);
+ mbstate_t mbstate;
+ size_t charlen;
+
+ memset (&mbstate, 0, sizeof mbstate);
+ 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,