summaryrefslogtreecommitdiff
path: root/tests/getcwd-lgpl.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/getcwd-lgpl.c')
-rw-r--r--tests/getcwd-lgpl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/getcwd-lgpl.c b/tests/getcwd-lgpl.c
index 67ed2878..dacafb91 100644
--- a/tests/getcwd-lgpl.c
+++ b/tests/getcwd-lgpl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2026 Free Software Foundation, Inc.
This file is part of gnulib.
This file is free software: you can redistribute it and/or modify
@@ -45,8 +45,6 @@ typedef int dummy;
char *
rpl_getcwd (char *buf, size_t size)
{
- char *result;
-
/* Handle single size operations. */
if (buf)
{
@@ -67,7 +65,7 @@ rpl_getcwd (char *buf, size_t size)
errno = ENOMEM;
return NULL;
}
- result = getcwd (buf, size);
+ char *result = getcwd (buf, size);
if (!result)
free (buf);
return result;
@@ -82,7 +80,7 @@ rpl_getcwd (char *buf, size_t size)
char *ptr = getcwd (tmp, size);
if (ptr)
{
- result = strdup (ptr);
+ char *result = strdup (ptr);
if (!result)
errno = ENOMEM;
return result;
@@ -92,6 +90,7 @@ rpl_getcwd (char *buf, size_t size)
}
/* My what a large directory name we have. */
+ char *result;
do
{
size <<= 1;