NULL, 0,
NI_NUMERICHOST);
- __asprintf (&buf, _("connect to address %s: "), 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);
- else
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf(stderr, L"%s", buf);
+ else
#endif
- fputs (buf, stderr);
+ fputs (buf, stderr);
+ free (buf);
+ }
__set_errno (oerrno);
perror(0);
ai = ai->ai_next;
paddr, sizeof(paddr),
NULL, 0,
NI_NUMERICHOST);
- __asprintf (&buf, _("Trying %s...\n"), paddr);
+ if (__asprintf (&buf, _("Trying %s...\n"), paddr) >= 0)
+ {
#ifdef USE_IN_LIBIO
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
#endif
- fputs (buf, stderr);
- free (buf);
+ fputs (buf, stderr);
+ free (buf);
+ }
continue;
}
if (refused && timo <= 16) {
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);
- else
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf(stderr, L"%s", buf);
+ else
#endif
- fputs (buf, stderr);
- free (buf);
+ fputs (buf, stderr);
+ free (buf);
+ }
(void)__close(s2);
goto bad;
}
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);
- else
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
#endif
- fputs (buf, stderr);
- free (buf);
+ fputs (buf, stderr);
+ free (buf);
+ }
(void)__close(s2);
goto bad;
}
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);
- else
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
#endif
- fputs (buf, stderr);
- free (buf);
+ fputs (buf, stderr);
+ free (buf);
+ }
goto bad2;
}
}
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);
- else
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
#endif
- fputs (buf, stderr);
- free (buf);
+ fputs (buf, stderr);
+ free (buf);
+ }
goto bad2;
}
if (c != 0) {
#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);
- else
- fputs (buf, stderr);
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
+ fputs (buf, stderr);
- free (buf);
+ free (buf);
+ }
#else
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
{
#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);
+ argv[0], pfound->name);
#else
fprintf (stderr, _("\
%s: option `--%s' doesn't allow an argument\n"),
{
/* +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);
+ argv[0], argv[optind - 1][0],
+ pfound->name);
#else
fprintf (stderr, _("\
%s: option `%c%s' doesn't allow an argument\n"),
}
#if defined _LIBC && defined USE_IN_LIBIO
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ if (n >= 0)
+ {
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
+ fputs (buf, stderr);
- free (buf);
+ free (buf);
+ }
#endif
}
#if defined _LIBC && defined USE_IN_LIBIO
char *buf;
- __asprintf (&buf,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
-
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ 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);
+ free (buf);
+ }
#else
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
{
#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"),
- argv[0], nextchar);
+ n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"),
+ argv[0], nextchar);
#else
fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
argv[0], nextchar);
{
/* +option or -option */
#if defined _LIBC && defined USE_IN_LIBIO
- __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
+ n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
+ argv[0], argv[optind][0], nextchar);
#else
fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
argv[0], argv[optind][0], nextchar);
}
#if defined _LIBC && defined USE_IN_LIBIO
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ if (n >= 0)
+ {
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
+ fputs (buf, stderr);
- free (buf);
+ free (buf);
+ }
#endif
}
nextchar = (char *) "";
{
#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"),
- argv[0], c);
+ n = __asprintf (&buf, _("%s: illegal option -- %c\n"),
+ argv[0], c);
#else
fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
#endif
else
{
#if defined _LIBC && defined USE_IN_LIBIO
- __asprintf (&buf, _("%s: invalid option -- %c\n"),
- argv[0], c);
+ n = __asprintf (&buf, _("%s: invalid option -- %c\n"),
+ argv[0], c);
#else
fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
#endif
}
#if defined _LIBC && defined USE_IN_LIBIO
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ if (n >= 0)
+ {
+ if (_IO_fwide (stderr, 0) > 0)
+ __fwprintf (stderr, L"%s", buf);
+ else
+ fputs (buf, stderr);
- free (buf);
+ free (buf);
+ }
#endif
}
optopt = c;
#if defined _LIBC && defined USE_IN_LIBIO
char *buf;
- __asprintf (&buf, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
-
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ 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);
+ free (buf);
+ }
#else
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
argv[0], c);
#if defined _LIBC && defined USE_IN_LIBIO
char *buf;
- __asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
-
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ 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);
+ free (buf);
+ }
#else
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]);
#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);
-
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
-
- free (buf);
+ 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"),
#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]);
-
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
-
- free (buf);
+ 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"),
#if defined _LIBC && defined USE_IN_LIBIO
char *buf;
- __asprintf (&buf,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
-
- if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s", buf);
- else
- fputs (buf, stderr);
+ 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);
+ free (buf);
+ }
#else
fprintf (stderr,
_("%s: option requires an argument -- %c\n"),