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:
parent
bee1a5f180
commit
b5d61a25cb
5 changed files with 11 additions and 19 deletions
5
lcl.c
5
lcl.c
|
@ -9,9 +9,6 @@
|
|||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
#include <errno.h>
|
||||
#ifdef __OpenBSD__
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
@ -225,7 +222,7 @@ cl_options(lua_State *L)
|
|||
|
||||
/* parameter type checking */
|
||||
luaL_checktype(L, 1, LUA_TTABLE);
|
||||
strlcpy(optstring, luaL_checkstring(L, 2), lua_rawlen(L, 2) * sizeof(char *));
|
||||
strbcpy(optstring, luaL_checkstring(L, 2), lua_rawlen(L, 2) * sizeof(char *));
|
||||
luaL_checktype(L, 3, LUA_TFUNCTION);
|
||||
|
||||
argc = (int)lua_rawlen(L, 1) + 1; /* get argv length */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue