summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/src/objectcopynamestring.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/exec/score/src/objectcopynamestring.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/c/src/exec/score/src/objectcopynamestring.c b/c/src/exec/score/src/objectcopynamestring.c
index cd0779d546..eb196f3d25 100644
--- a/c/src/exec/score/src/objectcopynamestring.c
+++ b/c/src/exec/score/src/objectcopynamestring.c
@@ -39,7 +39,10 @@ void _Objects_Copy_name_string(
unsigned8 *source_p = (unsigned8 *) source;
unsigned8 *destination_p = (unsigned8 *) destination;
- do {
- *destination_p++ = *source_p;
- } while ( *source_p++ );
+ *destination_p = '\0';
+ if ( source_p ) {
+ do {
+ *destination_p++ = *source_p;
+ } while ( *source_p++ );
+ }
}