rename the statically linked strlcpy to strbcpy

stands for "string bounds copy". Some systems like macOS include their
very own version of strlcpy and testing for that would require some
bloat like gnu automake so I'm just gonna rename it to prevent any
future conflicts. I only test on Linux and OpenBSD anyway. ;)
This commit is contained in:
Jeremy Baxter 2024-01-25 19:47:57 +13:00
parent bee1a5f180
commit b5d61a25cb
5 changed files with 11 additions and 19 deletions

View file

@ -168,9 +168,9 @@ process_pidof(lua_State *L)
/* construct pgrep command */
memset(command, 0, PROCESS_MAX * sizeof(char));
strlcat(command, "pgrep '", PROCESS_MAX);
strlcat(command, process, PROCESS_MAX);
strlcat(command, "' | sed 1q", PROCESS_MAX);
strbcat(command, "pgrep '", PROCESS_MAX);
strbcat(command, process, PROCESS_MAX);
strbcat(command, "' | sed 1q", PROCESS_MAX);
p = popen(command, "r");
buffer = malloc(PID_MAX * sizeof(char *));