Hack by Robert Scheck for nc <= 1.84 to get the package rebuilt on SuSE Linux Enterprise Server 10 with the Service Pack 2. Without this hack an error message with "undefined reference to g_strlcpy" is thrown during compiling. For further information how and why this hack was created, have a look: http://linux.robert-scheck.de/software/sles-10-virt-manager/ --- nc/netcat.c 2008-12-12 12:30:07.000000000 +0100 +++ nc/netcat.c.g_strlcpy 2008-12-12 12:30:36.000000000 +0100 @@ -113,6 +113,39 @@ static int connect_with_timeout(int fd, const struct sockaddr *sa, socklen_t salen, int ctimeout); +gsize +g_strlcpy (gchar *dest, + const gchar *src, + gsize dest_size) +{ + register gchar *d = dest; + register const gchar *s = src; + register gsize n = dest_size; + + /* Copy as many bytes as will fit */ + if (n != 0 && --n != 0) + do + { + register gchar c = *s++; + + *d++ = c; + if (c == 0) + break; + } + while (--n != 0); + + /* If not enough room in dest, add NUL and traverse rest of src */ + if (n == 0) + { + if (dest_size != 0) + *d = 0; + while (*s++) + ; + } + + return s - src - 1; /* count does not include NUL */ +} + int main(int argc, char *argv[]) {