Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomocy committed Feb 25, 2024
1 parent 1194df2 commit 0108679
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const char* get_dir(const char* path)
// According to dirname(3)(https://man7.org/linux/man-pages/man3/dirname.3p.html),
// dirname can modify both the given path and the return value.
// Especially, the return value may be overwritten by subsequent calls, which is error-prune.
// To avois such behaviour, copy values before use.
// To avoid such behaviour, copy values before use.

char* const path2 = copy_str(path);
const char* const dir = dirname(path2);
Expand Down

0 comments on commit 0108679

Please sign in to comment.