Mercurial > hg > octave-lyh > gnulib-hg
changeset 5620:da8bb7da9b79
(__argp_error): Check return value of __asprintf
(__argp_failure): Translate error message
author | Sergey Poznyakoff <gray@gnu.org.ua> |
---|---|
date | Mon, 24 Jan 2005 13:06:58 +0000 |
parents | eb7f3df972c6 |
children | 2757e462760b |
files | lib/argp-help.c |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/argp-help.c +++ b/lib/argp-help.c @@ -1745,7 +1745,8 @@ { char *buf; - __asprintf (&buf, fmt, ap); + if (__asprintf (&buf, fmt, ap) < 0) + buf = NULL; __fwprintf (stream, L"%s: %s\n", state ? state->name : __argp_short_program_name (), @@ -1823,7 +1824,8 @@ { char *buf; - __asprintf (&buf, fmt, ap); + if (__asprintf (&buf, fmt, ap) < 0) + buf = NULL; __fwprintf (stream, L": %s", buf); @@ -1863,7 +1865,8 @@ #endif #if !_LIBC if (! s && ! (s = strerror (errnum))) - s = "Unknown system error"; /* FIXME: translate this */ + s = dgettext (state->root_argp->argp_domain, + "Unknown system error"); #endif fputs (s, stream); }