summaryrefslogtreecommitdiff
path: root/tests/strerror_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/strerror_r.c')
-rw-r--r--tests/strerror_r.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/strerror_r.c b/tests/strerror_r.c
index 1e6974e3..ec7bfe6b 100644
--- a/tests/strerror_r.c
+++ b/tests/strerror_r.c
@@ -1,6 +1,6 @@
/* strerror_r.c --- POSIX compatible system error routine
- Copyright (C) 2010-2025 Free Software Foundation, Inc.
+ Copyright (C) 2010-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -103,10 +103,8 @@ static int
local_snprintf (char *buf, size_t buflen, const char *format, ...)
{
va_list args;
- int result;
-
va_start (args, format);
- result = _vsnprintf (buf, buflen, format, args);
+ int result = _vsnprintf (buf, buflen, format, args);
va_end (args);
if (buflen > 0 && (result < 0 || result >= buflen))
buf[buflen - 1] = '\0';
@@ -222,9 +220,8 @@ strerror_r (int errnum, char *buf, size_t buflen)
if (!ret && strlen (buf) == buflen - 1)
{
char stackbuf[STACKBUF_LEN];
- size_t len;
strerror_r (errnum, stackbuf, sizeof stackbuf);
- len = strlen (stackbuf);
+ size_t len = strlen (stackbuf);
/* STACKBUF_LEN should have been large enough. */
if (len + 1 == sizeof stackbuf)
abort ();