diff lib/misc.c @ 249:094e83b55cb1

2003-8-7 Brian Masney <masneyb@gftp.org> * lib/cache.c lib/misc.c lib/protocols.c lib/pty.c - make sure a NUL byte appears at the end of the buffer after the call to strncpy * lib/rfc959.c - increased buffer size to directory parsing routine
author masneyb
date Fri, 08 Aug 2003 02:24:54 +0000
parents f41650dc896c
children 71d0098c3735
line wrap: on
line diff
--- a/lib/misc.c	Fri Aug 08 01:38:12 2003 +0000
+++ b/lib/misc.c	Fri Aug 08 02:24:54 2003 +0000
@@ -42,7 +42,10 @@
   if (len == 0)
     {
       if (dest_str != NULL)
-        strncpy (dest_str, "0", dest_len);
+        {
+          strncpy (dest_str, "0", dest_len);
+          dest_str[dest_len - 1] = '\0';
+        }
       else
         dest_str = g_strdup ("0");
       return (dest_str);