diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-12-23 12:40:17 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-12-23 13:12:07 +0200 |
commit | f8fef13d33dbe80c44f800ca0312c0e03c5ae137 (patch) | |
tree | bf3650597de0825ae181122b7bcdfd67475af7d1 /src/gl/vasnprintf.c | |
parent | 23d96f1b9613d33a6fb50bf892a7accbab1332ba (diff) | |
download | gnutls-f8fef13d33dbe80c44f800ca0312c0e03c5ae137.tar.gz |
updated gnulib
Diffstat (limited to 'src/gl/vasnprintf.c')
-rw-r--r-- | src/gl/vasnprintf.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gl/vasnprintf.c b/src/gl/vasnprintf.c index ec7302a96e..6b30cebdff 100644 --- a/src/gl/vasnprintf.c +++ b/src/gl/vasnprintf.c @@ -5179,18 +5179,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* SNPRINTF or sprintf failed. Save and use the errno that it has set, if any. */ int saved_errno = errno; + if (saved_errno == 0) + { + if (dp->conversion == 'c' || dp->conversion == 's') + saved_errno = EILSEQ; + else + saved_errno = EINVAL; + } if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); - errno = - (saved_errno != 0 - ? saved_errno - : (dp->conversion == 'c' || dp->conversion == 's' - ? EILSEQ - : EINVAL)); + + errno = saved_errno; return NULL; } |