Skip to content

Commit

Permalink
core/std: add BrStpCpy()
Browse files Browse the repository at this point in the history
  • Loading branch information
erysdren committed May 10, 2024
1 parent 7c56e86 commit b1b6934
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/fmt/savegltf.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static char *build_buffer_uri(const cgltf_buffer *buffer, void *res)
code_out = BrResAllocate(res, sizeof(prefix) + len + 1, BR_MEMORY_APPLICATION);
memcpy(code_out, prefix, sizeof(prefix));

code_out_end = stpcpy(code_out, prefix);
code_out_end = BrStpCpy(code_out, prefix);

cbase64_init_encodestate(&es);
code_out_end += cbase64_encode_block(buffer->data, buffer->size, code_out_end, &es);
Expand Down
1 change: 1 addition & 0 deletions core/fw/include/brstdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ char *BR_PUBLIC_ENTRY BrStrCat(char *s1, const char *s2);
int BR_PUBLIC_ENTRY BrStrCmp(const char *s1, const char *s2);
int BR_PUBLIC_ENTRY BrStrICmp(const char *s1, const char *s2);
char *BR_PUBLIC_ENTRY BrStrCpy(char *s1, const char *s2);
char *BR_PUBLIC_ENTRY BrStpCpy(char *s1, const char *s2);
br_size_t BR_PUBLIC_ENTRY BrStrLen(const char *s);
int BR_PUBLIC_ENTRY BrStrNCmp(const char *s1, const char *s2, br_size_t n);
int BR_PUBLIC_ENTRY BrStrNICmp(const char *s1, const char *s2, br_size_t n);
Expand Down
5 changes: 5 additions & 0 deletions core/std/stdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ char *BR_PUBLIC_ENTRY BrStrCpy(char *s1, const char *s2)
return strcpy(s1, s2);
}

char *BR_PUBLIC_ENTRY BrStpCpy(char *s1, const char *s2)
{
return strcpy(s1, s2) + strlen(s2);
}

br_size_t BR_PUBLIC_ENTRY BrStrLen(const char *s)
{
return strlen(s);
Expand Down

0 comments on commit b1b6934

Please sign in to comment.