diff src/client.c @ 268:f049f8639dc0 noffle

[svn] * src/client.c: Fix old bug in readField() where the last field in a line would not terminate the buffer properly if the line ended with \0. This could in practice lead to rubbish in the Lines: field, with extra numerals from the preceding Bytes: field being added.
author bears
date Tue, 08 Oct 2002 14:52:52 +0100
parents 93d5d8b098da
children 3477050e8d10
line wrap: on
line diff
--- a/src/client.c	Mon Aug 05 23:15:49 2002 +0100
+++ b/src/client.c	Tue Oct 08 14:52:52 2002 +0100
@@ -1,7 +1,7 @@
 /*
   client.c
 
-  $Id: client.c 382 2002-06-05 22:03:44Z mirkol $
+  $Id: client.c 400 2002-10-08 13:52:52Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -712,7 +712,10 @@
     while ( *p != '\t' && *p != '\n' )
     {
         if ( ! *p )
+	{
+	    *r = '\0';
             return p;
+	}
         *(r++) = *(p++);
         ++len;
         if ( len >= MAXCHAR - 1 )