Skip to content

Commit 1ed9330

Browse files
committed
refactor: minor refactoring for &-concatenated strings
1 parent 721e8e4 commit 1ed9330

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

cobj/cobj.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,6 @@ static void package_name_to_path(char *buff, char *package_name) {
18171817
*b_p = *p_p;
18181818
}
18191819
}
1820-
*b_p = '\0';
18211820
}
18221821

18231822
static int process_compile(struct filename *fn) {

cobj/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ struct cb_literal *build_concat_literal(enum cb_category category,
474474
p->segment_sizes = cobc_malloc(sizeof(size_t) * (sgmt_count + 1));
475475
memcpy(p->segment_sizes, sgmt_sizes, sizeof(size_t) * sgmt_count);
476476
}
477-
memcpy(p->segment_sizes + sgmt_count, &size2, sizeof(size_t));
477+
p->segment_sizes[sgmt_count] = size2;
478478
p->segment_count = sgmt_count + 1;
479479

480480
return p;

0 commit comments

Comments
 (0)