fix(portability): replace POSIX-only string funcs and legacy hostent fields

This commit is contained in:
2026-01-26 15:56:52 -07:00
parent 4ad5df0370
commit 4008d94571
7 changed files with 20 additions and 14 deletions

View File

@@ -1,3 +1,4 @@
#include <glib.h>
/* X-Chat
* Copyright (C) 1998 Peter Zelezny.
*
@@ -24,7 +25,7 @@ void
history_add (struct history *his, char *text)
{
free (his->lines[his->realpos]);
his->lines[his->realpos] = strdup (text);
his->lines[his->realpos] = g_strdup(text);
his->realpos++;
if (his->realpos == HISTORY_SIZE)
his->realpos = 0;