/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1990-1998, 2000-2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
char *strerror_r ();
# endif
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
+# ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+# endif
/* The calling program should define program_name and set it to the
name of the executing program. */
static void
print_errno_message (int errnum)
{
- char const *s;
+ char const *s = NULL;
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
# else
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
s = errbuf;
- else
- s = 0;
# endif
-#else
- s = strerror (errnum);
#endif
#if !_LIBC
- if (! s)
+ if (! s && ! (s = strerror (errnum)))
s = _("Unknown system error");
#endif
size_t len = strlen (message) + 1;
const wchar_t *wmessage = L"out of memory";
wchar_t *wbuf = (len < ALLOCA_LIMIT
- ? (void *) alloca (len * sizeof *wbuf)
+ ? alloca (len * sizeof *wbuf)
: len <= SIZE_MAX / sizeof *wbuf
? malloc (len * sizeof *wbuf)
: NULL);