mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-18 06:30:05 +00:00
Update.
2001-12-06 Ulrich Drepper <drepper@redhat.com> * libio/vasprintf.c (_IO_vasprintf): Free buffer on failure. * assert/assert.c: Check result of __asprintf call and don't use string if it failed. * assert/assert-perr.c: Likewise. * inet/rcmd.c: Likewise. * locale/programs/localedef.c (main): Check result of construct_output_path and exit if it failed. (construct_output_path): Check result of asprintf and mkdir calls and fail if they failed. * posix/getopt.c: Check result of __asprintf calls and fail if they failed. Patch by Dmitry V. Levin <ldv@alt-linux.org>.
This commit is contained in:
parent
1e06620a7b
commit
383bd1c503
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
2001-12-06 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* libio/vasprintf.c (_IO_vasprintf): Free buffer on failure.
|
||||
* assert/assert.c: Check result of __asprintf call and don't use
|
||||
string if it failed.
|
||||
* assert/assert-perr.c: Likewise.
|
||||
* inet/rcmd.c: Likewise.
|
||||
* locale/programs/localedef.c (main): Check result of
|
||||
construct_output_path and exit if it failed.
|
||||
(construct_output_path): Check result of asprintf and mkdir calls and
|
||||
fail if they failed.
|
||||
* posix/getopt.c: Check result of __asprintf calls and fail if
|
||||
they failed.
|
||||
Patch by Dmitry V. Levin <ldv@alt-linux.org>.
|
||||
|
||||
2001-12-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* sysdeps/generic/strcasecmp.c (__strcasecmp): Little performance
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sysdep.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
extern const char *__progname;
|
||||
@ -53,12 +54,12 @@ __assert_perror_fail (int errnum,
|
||||
FATAL_PREPARE;
|
||||
#endif
|
||||
|
||||
(void) __asprintf (&buf, _("%s%s%s:%u: %s%sUnexpected error: %s.\n"),
|
||||
if (__asprintf (&buf, _("%s%s%s:%u: %s%sUnexpected error: %s.\n"),
|
||||
__progname, __progname[0] ? ": " : "",
|
||||
file, line,
|
||||
function ? function : "", function ? ": " : "",
|
||||
__strerror_r (errnum, errbuf, sizeof errbuf));
|
||||
|
||||
__strerror_r (errnum, errbuf, sizeof errbuf)) >= 0)
|
||||
{
|
||||
/* Print the message. */
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
@ -72,6 +73,11 @@ __assert_perror_fail (int errnum,
|
||||
/* We have to free the buffer since the appplication might catch the
|
||||
SIGABRT. */
|
||||
free (buf);
|
||||
}
|
||||
else
|
||||
/* At least print a minimal message. */
|
||||
#define STR_N_LEN(str) str, sizeof (str) - 1
|
||||
__libc_write (STDERR_FILENO, STR_N_LEN ("Unexpected error.\n"));
|
||||
|
||||
abort ();
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sysdep.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
extern const char *__progname;
|
||||
@ -51,12 +52,12 @@ __assert_fail (const char *assertion, const char *file, unsigned int line,
|
||||
FATAL_PREPARE;
|
||||
#endif
|
||||
|
||||
(void) __asprintf (&buf, _("%s%s%s:%u: %s%sAssertion `%s' failed.\n"),
|
||||
if (__asprintf (&buf, _("%s%s%s:%u: %s%sAssertion `%s' failed.\n"),
|
||||
__progname, __progname[0] ? ": " : "",
|
||||
file, line,
|
||||
function ? function : "", function ? ": " : "",
|
||||
assertion);
|
||||
|
||||
assertion) >= 0)
|
||||
{
|
||||
/* Print the message. */
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
@ -70,6 +71,11 @@ __assert_fail (const char *assertion, const char *file, unsigned int line,
|
||||
/* We have to free the buffer since the appplication might catch the
|
||||
SIGABRT. */
|
||||
free (buf);
|
||||
}
|
||||
else
|
||||
/* At least print a minimal message. */
|
||||
#define STR_N_LEN(str) str, sizeof (str) - 1
|
||||
__libc_write (STDERR_FILENO, STR_N_LEN ("Unexpected error.\n"));
|
||||
|
||||
abort ();
|
||||
}
|
||||
|
73
inet/rcmd.c
73
inet/rcmd.c
@ -206,21 +206,9 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
|
||||
NULL, 0,
|
||||
NI_NUMERICHOST);
|
||||
|
||||
__asprintf (&buf, _("connect to address %s: "), paddr);
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf(stderr, L"%s", buf);
|
||||
else
|
||||
#endif
|
||||
fputs (buf, stderr);
|
||||
__set_errno (oerrno);
|
||||
perror(0);
|
||||
ai = ai->ai_next;
|
||||
getnameinfo(ai->ai_addr, ai->ai_addrlen,
|
||||
paddr, sizeof(paddr),
|
||||
NULL, 0,
|
||||
NI_NUMERICHOST);
|
||||
__asprintf (&buf, _("Trying %s...\n"), paddr);
|
||||
if (__asprintf (&buf, _("connect to address %s: "),
|
||||
paddr) >= 0)
|
||||
{
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf(stderr, L"%s", buf);
|
||||
@ -228,6 +216,24 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
|
||||
#endif
|
||||
fputs (buf, stderr);
|
||||
free (buf);
|
||||
}
|
||||
__set_errno (oerrno);
|
||||
perror(0);
|
||||
ai = ai->ai_next;
|
||||
getnameinfo(ai->ai_addr, ai->ai_addrlen,
|
||||
paddr, sizeof(paddr),
|
||||
NULL, 0,
|
||||
NI_NUMERICHOST);
|
||||
if (__asprintf (&buf, _("Trying %s...\n"), paddr) >= 0)
|
||||
{
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
#endif
|
||||
fputs (buf, stderr);
|
||||
free (buf);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (refused && timo <= 16) {
|
||||
@ -267,8 +273,9 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
|
||||
if (__write(s, num, strlen(num)+1) != (ssize_t)strlen(num)+1) {
|
||||
char *buf = NULL;
|
||||
|
||||
__asprintf (&buf, _("\
|
||||
rcmd: write (setting up stderr): %m\n"));
|
||||
if (__asprintf (&buf, _("\
|
||||
rcmd: write (setting up stderr): %m\n")) >= 0)
|
||||
{
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf(stderr, L"%s", buf);
|
||||
@ -276,6 +283,7 @@ rcmd: write (setting up stderr): %m\n"));
|
||||
#endif
|
||||
fputs (buf, stderr);
|
||||
free (buf);
|
||||
}
|
||||
(void)__close(s2);
|
||||
goto bad;
|
||||
}
|
||||
@ -285,12 +293,13 @@ rcmd: write (setting up stderr): %m\n"));
|
||||
if (__poll (pfd, 2, -1) < 1 || (pfd[1].revents & POLLIN) == 0){
|
||||
char *buf = NULL;
|
||||
|
||||
if (errno != 0)
|
||||
__asprintf(&buf,
|
||||
_("rcmd: poll (setting up stderr): %m\n"));
|
||||
else
|
||||
__asprintf(&buf,
|
||||
_("poll: protocol failure in circuit setup\n"));
|
||||
if ((errno != 0
|
||||
&& __asprintf(&buf, _("\
|
||||
rcmd: poll (setting up stderr): %m\n")) >= 0)
|
||||
|| (errno == 0
|
||||
&& __asprintf(&buf, _("\
|
||||
poll: protocol failure in circuit setup\n")) >= 0))
|
||||
{
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
@ -298,6 +307,7 @@ rcmd: write (setting up stderr): %m\n"));
|
||||
#endif
|
||||
fputs (buf, stderr);
|
||||
free (buf);
|
||||
}
|
||||
(void)__close(s2);
|
||||
goto bad;
|
||||
}
|
||||
@ -331,8 +341,9 @@ rcmd: write (setting up stderr): %m\n"));
|
||||
if (rport >= IPPORT_RESERVED || rport < IPPORT_RESERVED / 2){
|
||||
char *buf = NULL;
|
||||
|
||||
__asprintf(&buf,
|
||||
_("socket: protocol failure in circuit setup\n"));
|
||||
if (__asprintf(&buf, _("\
|
||||
socket: protocol failure in circuit setup\n")) >= 0)
|
||||
{
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
@ -340,6 +351,7 @@ rcmd: write (setting up stderr): %m\n"));
|
||||
#endif
|
||||
fputs (buf, stderr);
|
||||
free (buf);
|
||||
}
|
||||
goto bad2;
|
||||
}
|
||||
}
|
||||
@ -350,10 +362,12 @@ rcmd: write (setting up stderr): %m\n"));
|
||||
if (n != 1) {
|
||||
char *buf = NULL;
|
||||
|
||||
if (n == 0)
|
||||
__asprintf(&buf, _("rcmd: %s: short read"), *ahost);
|
||||
else
|
||||
__asprintf(&buf, "rcmd: %s: %m\n", *ahost);
|
||||
if ((n == 0
|
||||
&& __asprintf(&buf, _("rcmd: %s: short read"),
|
||||
*ahost) >= 0)
|
||||
|| (n != 0
|
||||
&& __asprintf(&buf, "rcmd: %s: %m\n", *ahost) >= 0))
|
||||
{
|
||||
#ifdef USE_IN_LIBIO
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
@ -361,6 +375,7 @@ rcmd: write (setting up stderr): %m\n"));
|
||||
#endif
|
||||
fputs (buf, stderr);
|
||||
free (buf);
|
||||
}
|
||||
goto bad2;
|
||||
}
|
||||
if (c != 0) {
|
||||
|
@ -60,7 +60,10 @@ _IO_vasprintf (result_ptr, format, args)
|
||||
sf._s._free_buffer = (_IO_free_type) free;
|
||||
ret = _IO_vfprintf (&sf._sbf._f, format, args);
|
||||
if (ret < 0)
|
||||
{
|
||||
free (sf._sbf._f._IO_buf_base);
|
||||
return ret;
|
||||
}
|
||||
/* Only use realloc if the size we need is of the same order of
|
||||
magnitude then the memory we allocated. */
|
||||
needed = sf._sbf._f._IO_write_ptr - sf._sbf._f._IO_write_base + 1;
|
||||
|
@ -177,6 +177,8 @@ main (int argc, char *argv[])
|
||||
/* The parameter describes the output path of the constructed files.
|
||||
If the described files cannot be written return a NULL pointer. */
|
||||
output_path = construct_output_path (argv[remaining]);
|
||||
if (output_path == NULL)
|
||||
error (4, errno, _("cannot create directory for output files"));
|
||||
cannot_write_why = errno;
|
||||
|
||||
/* Now that the parameters are processed we have to reset the local
|
||||
@ -374,6 +376,9 @@ construct_output_path (char *path)
|
||||
output_prefix ?: "", LOCALEDIR,
|
||||
(int) (startp - path), path, normal, endp, '\0');
|
||||
|
||||
if (n < 0)
|
||||
return NULL;
|
||||
|
||||
endp = result + n - 1;
|
||||
}
|
||||
else
|
||||
@ -392,7 +397,8 @@ construct_output_path (char *path)
|
||||
if (errno == ENOENT)
|
||||
{
|
||||
errno = 0;
|
||||
mkdir (result, 0777);
|
||||
if (mkdir (result, 0777) < 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*endp++ = '/';
|
||||
|
@ -685,8 +685,9 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
|
||||
argv[0], argv[optind]) >= 0)
|
||||
{
|
||||
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
@ -694,6 +695,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#else
|
||||
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
@ -721,13 +723,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
int n;
|
||||
#endif
|
||||
|
||||
if (argv[optind - 1][1] == '-')
|
||||
{
|
||||
/* --option */
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
__asprintf (&buf, _("\
|
||||
n = __asprintf (&buf, _("\
|
||||
%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
#else
|
||||
@ -740,7 +743,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
/* +option or -option */
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
__asprintf (&buf, _("\
|
||||
n = __asprintf (&buf, _("\
|
||||
%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0],
|
||||
pfound->name);
|
||||
@ -752,12 +755,15 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
}
|
||||
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
if (n >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -778,16 +784,17 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
|
||||
if (__asprintf (&buf, _("\
|
||||
%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]) >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#else
|
||||
fprintf (stderr,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
@ -821,13 +828,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
int n;
|
||||
#endif
|
||||
|
||||
if (argv[optind][1] == '-')
|
||||
{
|
||||
/* --option */
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
__asprintf (&buf, _("%s: unrecognized option `--%s'\n"),
|
||||
n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"),
|
||||
argv[0], nextchar);
|
||||
#else
|
||||
fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
|
||||
@ -838,7 +846,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
/* +option or -option */
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
__asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
|
||||
n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
|
||||
argv[0], argv[optind][0], nextchar);
|
||||
#else
|
||||
fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
|
||||
@ -847,12 +855,15 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
}
|
||||
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
if (n >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
nextchar = (char *) "";
|
||||
@ -878,13 +889,14 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
{
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
int n;
|
||||
#endif
|
||||
|
||||
if (posixly_correct)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
__asprintf (&buf, _("%s: illegal option -- %c\n"),
|
||||
n = __asprintf (&buf, _("%s: illegal option -- %c\n"),
|
||||
argv[0], c);
|
||||
#else
|
||||
fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
|
||||
@ -893,7 +905,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
else
|
||||
{
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
__asprintf (&buf, _("%s: invalid option -- %c\n"),
|
||||
n = __asprintf (&buf, _("%s: invalid option -- %c\n"),
|
||||
argv[0], c);
|
||||
#else
|
||||
fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
|
||||
@ -901,12 +913,15 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
}
|
||||
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
if (n >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
optopt = c;
|
||||
@ -939,15 +954,17 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf, _("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
|
||||
if (__asprintf (&buf,
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c) >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#else
|
||||
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
@ -1001,15 +1018,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
|
||||
if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
|
||||
argv[0], argv[optind]) >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#else
|
||||
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
@ -1035,16 +1053,17 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf, _("\
|
||||
if (__asprintf (&buf, _("\
|
||||
%s: option `-W %s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
|
||||
argv[0], pfound->name) >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#else
|
||||
fprintf (stderr, _("\
|
||||
%s: option `-W %s' doesn't allow an argument\n"),
|
||||
@ -1067,16 +1086,17 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf, _("\
|
||||
if (__asprintf (&buf, _("\
|
||||
%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
|
||||
argv[0], argv[optind - 1]) >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#else
|
||||
fprintf (stderr,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
@ -1132,16 +1152,17 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
#if defined _LIBC && defined USE_IN_LIBIO
|
||||
char *buf;
|
||||
|
||||
__asprintf (&buf,
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
|
||||
if (__asprintf (&buf, _("\
|
||||
%s: option requires an argument -- %c\n"),
|
||||
argv[0], c) >= 0)
|
||||
{
|
||||
if (_IO_fwide (stderr, 0) > 0)
|
||||
__fwprintf (stderr, L"%s", buf);
|
||||
else
|
||||
fputs (buf, stderr);
|
||||
|
||||
free (buf);
|
||||
}
|
||||
#else
|
||||
fprintf (stderr,
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
|
Loading…
Reference in New Issue
Block a user