* modules/getlogin-tests (Depends-on): Remove xalloc.
(test_getlogin_LDADD): Remove @LIBINTL@.
* tests/test-getlogin.c: Do not include xalloc.h.
(main): Use a static rather than heap storage.
2025-04-17 Paul Eggert <eggert@cs.ucla.edu>
+ getlogin-tests: remove xalloc dependency
+ * modules/getlogin-tests (Depends-on): Remove xalloc.
+ (test_getlogin_LDADD): Remove @LIBINTL@.
+ * tests/test-getlogin.c: Do not include xalloc.h.
+ (main): Use a static rather than heap storage.
+
Pacify GCC 15’s new -Wtrailing-whitespace option
* m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
* m4/iconv.m4 (AM_ICONV_LINK, AM_ICONV):
Depends-on:
bool
-xalloc
configure.ac:
Makefile.am:
TESTS += test-getlogin
check_PROGRAMS += test-getlogin
-test_getlogin_LDADD = $(LDADD) @LIBINTL@ $(GETLOGIN_LIB)
+test_getlogin_LDADD = $(LDADD) $(GETLOGIN_LIB)
#include "signature.h"
SIGNATURE_CHECK (getlogin, char *, (void));
-#include "xalloc.h"
-
#include "test-getlogin.h"
int
test_getlogin_result (buf, err);
/* Check that getlogin() does not merely return getenv ("LOGNAME"). */
- putenv (xstrdup ("LOGNAME=ygvfibmslhkmvoetbrcegzwydorcke"));
+ static char set_LOGNAME[] = "LOGNAME=ygvfibmslhkmvoetbrcegzwydorcke";
+ putenv (set_LOGNAME);
buf = getlogin ();
ASSERT (!(buf != NULL
- && strcmp (buf, "ygvfibmslhkmvoetbrcegzwydorcke") == 0));
+ && strcmp (buf, set_LOGNAME + sizeof "LOGNAME") == 0));
return test_exit_status;
}