Skip to content

Commit

Permalink
use strlcpy() instead of snprintf() on openbsd
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoechtrager committed Jul 19, 2015
1 parent 229e3ce commit 39b4baa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cctools/ld64/src/3rd/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int _NSGetExecutablePath(char *epath, unsigned int *size)
if (*comm == '/' || *comm == '.') {
char *rpath;
if ((rpath = realpath(comm, NULL))) {
snprintf(epath, *size, "%s", rpath);
strlcpy(epath, rpath, *size);
free(rpath);
ok = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion cctools/libstuff/emulated.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int _NSGetExecutablePath(char *epath, unsigned int *size)
if (*comm == '/' || *comm == '.') {
char *rpath;
if ((rpath = realpath(comm, NULL))) {
snprintf(epath, *size, "%s", rpath);
strlcpy(epath, rpath, *size);
free(rpath);
ok = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion usage_examples/ios_toolchain/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ char *get_executable_path(char *epath, size_t buflen)
if (*comm == '/' || *comm == '.') {
char *rpath;
if ((rpath = realpath(comm, NULL))) {
snprintf(epath, buflen, "%s", rpath);
strlcpy(epath, rpath, buflen);
free(rpath);
ok = 1;
}
Expand Down

0 comments on commit 39b4baa

Please sign in to comment.