openbsd-ports/lang/lua/patches/patch-src_luaconf_h
espie 4c64f036a5 obvious dependency fix.
also regen patches.
2007-10-29 20:30:32 +00:00

31 lines
1.0 KiB
Plaintext

$OpenBSD: patch-src_luaconf_h,v 1.3 2007/10/29 20:30:32 espie Exp $
--- src/luaconf.h.orig Sat Mar 24 04:01:55 2007
+++ src/luaconf.h Mon Oct 29 21:26:20 2007
@@ -33,7 +33,7 @@
#define LUA_WIN
#endif
-#if defined(LUA_USE_LINUX)
+#if defined(LUA_USE_BSD) || defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */
@@ -519,7 +519,7 @@
*/
#define LUA_NUMBER_SCAN "%lf"
#define LUA_NUMBER_FMT "%.14g"
-#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
+#define lua_number2str(s,n) snprintf((s), sizeof((s)), LUA_NUMBER_FMT, (n))
#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */
#define lua_str2number(s,p) strtod((s), (p))
@@ -646,7 +646,7 @@ union luai_Cast { double l_d; long l_l; };
#include <unistd.h>
#define LUA_TMPNAMBUFSIZE 32
#define lua_tmpnam(b,e) { \
- strcpy(b, "/tmp/lua_XXXXXX"); \
+ strlcpy(b, "/tmp/lua_XXXXXX", sizeof(b)); \
e = mkstemp(b); \
if (e != -1) close(e); \
e = (e == -1); }