Skip to content

Commit 010f1f1

Browse files
authored
chore(agent): Changes code to use NR string routines (#949)
Switches to use nr_strlcpy and nr_strcpy instead of libc versions for better platform generality.
1 parent a95eb51 commit 010f1f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

agent/lib_aws_sdk_php.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ void nr_lib_aws_sdk_php_add_supportability_service_metric(
8888
}
8989

9090
cp = buf;
91-
strcpy(cp, PHP_AWS_SDK_SERVICE_NAME_METRIC_PREFIX);
91+
nr_strcpy(cp, PHP_AWS_SDK_SERVICE_NAME_METRIC_PREFIX);
9292
cp += PHP_AWS_SDK_SERVICE_NAME_METRIC_PREFIX_LEN - 1;
93-
strlcpy(cp, service_name, MAX_AWS_SERVICE_NAME_LEN);
93+
nr_strlcpy(cp, service_name, MAX_AWS_SERVICE_NAME_LEN);
9494
nrm_force_add(NRPRG(txn) ? NRTXN(unscoped_metrics) : 0, buf, 0);
9595
}
9696

axiom/nr_distributed_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ void nr_distributed_trace_set_trace_id(nr_distributed_trace_t* dt,
497497
for (int i = 0; i < padding; i++) {
498498
dest[i] = '0';
499499
}
500-
strcpy(dest + padding, trace_id);
500+
nr_strcpy(dest + padding, trace_id);
501501
dt->trace_id = dest;
502502
} else {
503503
dt->trace_id = nr_strdup(trace_id);

0 commit comments

Comments
 (0)