[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] error.c: minor changes
From: |
Jim Meyering |
Subject: |
[Bug-gnulib] error.c: minor changes |
Date: |
Fri, 26 Sep 2003 17:37:39 +0200 |
Here's a minor clean-up for error.c.
Any objection?
2003-09-26 Jim Meyering <address@hidden>
* error.c (error_tail): Move some declarations
into inner scope where the local variables are used.
Index: error.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/error.c,v
retrieving revision 1.35
diff -u -p -u -p -r1.35 error.c
--- error.c 26 Sep 2003 07:41:40 -0000 1.35
+++ error.c 26 Sep 2003 15:27:45 -0000
@@ -147,9 +147,6 @@ error_tail (int status, int errnum, cons
# define ALLOCA_LIMIT 2000
size_t len = strlen (message) + 1;
const wchar_t *wmessage = L"out of memory";
- mbstate_t st;
- size_t res;
- const char *tmp;
wchar_t *wbuf = (len < ALLOCA_LIMIT
? (void *) alloca (len * sizeof *wbuf)
: len <= SIZE_MAX / sizeof *wbuf
@@ -158,8 +155,10 @@ error_tail (int status, int errnum, cons
if (wbuf)
{
+ size_t res;
+ mbstate_t st;
+ const char *tmp = message;
memset (&st, '\0', sizeof (st));
- tmp =message;
res = mbsrtowcs (wbuf, &tmp, len, &st);
wmessage = res == (size_t) -1 ? L"???" : wbuf;
}
- [Bug-gnulib] error.c: minor changes,
Jim Meyering <=