summaryrefslogtreecommitdiff
path: root/source/cl_locs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/cl_locs.c')
-rw-r--r--source/cl_locs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/cl_locs.c b/source/cl_locs.c
index 71cef2d..8a08359 100644
--- a/source/cl_locs.c
+++ b/source/cl_locs.c
@@ -44,13 +44,13 @@ LOC_Alloc
static location_t *LOC_Alloc( const char *name ) {
location_t *loc;
char buffer[MAX_QPATH];
- size_t length;
+ size_t len;
- Q_ClearStr( buffer, name, sizeof( buffer ) );
+ Q_strlcpy( buffer, name, sizeof( buffer ) );
+ len = COM_strclr( buffer );
- length = strlen( buffer );
- loc = Z_Malloc( sizeof( *loc ) + length );
- memcpy( loc->name, buffer, length + 1 );
+ loc = Z_Malloc( sizeof( *loc ) + len );
+ memcpy( loc->name, buffer, len + 1 );
List_Append( &cl_locations, &loc->entry );
return loc;