score: Simplify _Workspace_String_duplicate()

This commit is contained in:
Sebastian Huber
2018-11-21 17:30:22 +01:00
parent 59e7209fb3
commit 52c7cb1fdc

View File

@@ -33,12 +33,13 @@ char *_Workspace_String_duplicate(
size_t len size_t len
) )
{ {
char *dup = _Workspace_Allocate(len + 1); char *dup;
dup = _Workspace_Allocate( len + 1 );
if ( dup == NULL ) {
return NULL;
}
if (dup != NULL) {
dup[ len ] = '\0'; dup[ len ] = '\0';
memcpy(dup, string, len); return memcpy( dup, string, len );
}
return dup;
} }