diff options
-rw-r--r-- | src/client/cl_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 9f8e4279..b9c20d34 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -2515,7 +2515,6 @@ The result is copied to *buf, and *data is advanced as appropriate void CL_GSRFeaturedLabel( byte **data, char *buf, int size ) { char *l = buf; - buf[0] = '\0'; // copy until '\0' which indicates field break // or slash which indicates beginning of server list @@ -2528,6 +2527,11 @@ void CL_GSRFeaturedLabel( byte **data, char *buf, int size ) "CL_GSRFeaturedLabel: overflow\n" ); l++, (*data)++; } + + if( l < &buf[ size - 1 ] ) + *l = '\0'; + else + buf[ size - 1 ] = '\0'; } #define MAX_SERVERSPERPACKET 256 |