Skip to content

Commit

Permalink
Remove redundant call to strcpy
Browse files Browse the repository at this point in the history
Differential Revision: D64566958

Pull Request resolved: #1406
  • Loading branch information
SanderMertens authored Oct 17, 2024
1 parent 74e2dc3 commit ba608b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions distr/flecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -21148,12 +21148,9 @@ char* ecs_cpp_get_symbol_name(
const char *type_name,
size_t len)
{
// Symbol is same as name, but with '::' replaced with '.'
ecs_os_strcpy(symbol_name, type_name);

char *ptr;
const char *ptr;
size_t i;
for (i = 0, ptr = symbol_name; i < len && *ptr; i ++, ptr ++) {
for (i = 0, ptr = type_name; i < len && *ptr; i ++, ptr ++) {
if (*ptr == ':') {
symbol_name[i] = '.';
ptr ++;
Expand Down
7 changes: 2 additions & 5 deletions src/addons/flecs_cpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,9 @@ char* ecs_cpp_get_symbol_name(
const char *type_name,
size_t len)
{
// Symbol is same as name, but with '::' replaced with '.'
ecs_os_strcpy(symbol_name, type_name);

char *ptr;
const char *ptr;
size_t i;
for (i = 0, ptr = symbol_name; i < len && *ptr; i ++, ptr ++) {
for (i = 0, ptr = type_name; i < len && *ptr; i ++, ptr ++) {
if (*ptr == ':') {
symbol_name[i] = '.';
ptr ++;
Expand Down

0 comments on commit ba608b2

Please sign in to comment.