diff options
Diffstat (limited to 'plugins/MirOTR/Libgpg-error')
-rw-r--r-- | plugins/MirOTR/Libgpg-error/strerror.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/MirOTR/Libgpg-error/strerror.c b/plugins/MirOTR/Libgpg-error/strerror.c index b0efb3de4b..4013e7ae26 100644 --- a/plugins/MirOTR/Libgpg-error/strerror.c +++ b/plugins/MirOTR/Libgpg-error/strerror.c @@ -103,25 +103,25 @@ system_strerror_r (int no, char *buf, size_t buflen) already thread-safe. */ static int -system_strerror_r (int no, char *buf, size_t buflen) +system_strerror_r(int no, char *buf, size_t buflen) { - char *errstr = strerror (no); + char *errstr = strerror(no); - if (!errstr) - { - int saved_errno = errno; + if (!errstr) + { + int saved_errno = errno; - if (saved_errno != EINVAL) - snprintf (buf, buflen, "strerror failed: %i\n", errno); - return saved_errno; - } - else - { - size_t errstr_len = strlen (errstr) + 1; - size_t cpy_len = errstr_len < buflen ? errstr_len : buflen; - memcpy (buf, errstr, cpy_len); - return cpy_len == errstr_len ? 0 : ERANGE; - } + if (saved_errno != EINVAL) + _snprintf(buf, buflen, "strerror failed: %i\n", errno); + return saved_errno; + } + else + { + size_t errstr_len = strlen(errstr) + 1; + size_t cpy_len = errstr_len < buflen ? errstr_len : buflen; + memcpy(buf, errstr, cpy_len); + return cpy_len == errstr_len ? 0 : ERANGE; + } } #endif |