gutils: Make a variable const to avoid an unnecessary cast

And fix a typo in a comment. This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-02-13 10:24:36 +00:00 committed by Simon McVittie
parent 7420f9eccd
commit f3064e8a5c

View File

@ -664,12 +664,12 @@ g_get_user_database_entry (void)
struct passwd *pw = NULL;
gpointer buffer = NULL;
gint error;
gchar *logname;
const char *logname;
# if defined (HAVE_GETPWUID_R)
struct passwd pwd;
# ifdef _SC_GETPW_R_SIZE_MAX
/* This reurns the maximum length */
/* This returns the maximum length */
glong bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
if (bufsize < 0)
@ -678,7 +678,7 @@ g_get_user_database_entry (void)
glong bufsize = 64;
# endif /* _SC_GETPW_R_SIZE_MAX */
logname = (gchar *) g_getenv ("LOGNAME");
logname = g_getenv ("LOGNAME");
do
{