diff --git a/src/ChangeLog b/src/ChangeLog index cc58e7265..b1c6c2a17 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,7 +5,7 @@ 2004-09-02 Roland Illig - * man2hlp.c (handle_link): Reverted the last change because + * man2hlp.c (handle_link): Added header "glib-compat.h" because glib-1.2 does not know g_strlcpy. 2004-09-02 Pavel S. Shirshov diff --git a/src/man2hlp.c b/src/man2hlp.c index a4e726f94..ef32fa617 100644 --- a/src/man2hlp.c +++ b/src/man2hlp.c @@ -25,6 +25,7 @@ #include #include "help.h" +#include "glib-compat.h" #define BUFFER_SIZE 256 @@ -611,8 +612,7 @@ handle_link (char *buffer) /* Bold text or italics text */ if (buffer[0] == '.' && (buffer[1] == 'I' || buffer[1] == 'B')) for (buffer += 2; *buffer == ' ' || *buffer == '\t'; buffer++); - strncpy (old, buffer, sizeof (old) - 1); - old[sizeof (old) - 1] = 0; + g_strlcpy (old, buffer, sizeof (old)); link_flag = 3; break; case 3: