about summary refs log tree commit diff stats
path: root/src/liolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/liolib.c')
-rw-r--r--src/liolib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/liolib.c b/src/liolib.c
index 6c03421..a22be20 100644
--- a/src/liolib.c
+++ b/src/liolib.c
@@ -132,7 +132,7 @@ static char iolib_errbuf[1024] = {0};
 static int io_open (lua_State *L) {
   const char *filename = luaL_checkstring(L, 1);
   const char *mode = luaL_optstring(L, 2, "r");
-  static buffer[1024] = {0};
+  static char buffer[1024] = {0};
   memset(buffer, '\0', 1024);
   snprintf(buffer, 1020, "io.open(\"%s\", \"%s\")", filename, mode);
   append_to_audit_log(L, buffer);
@@ -174,6 +174,10 @@ static int f_lines (lua_State *L) {
 static int io_lines (lua_State *L) {
   const char *filename = luaL_checkstring(L, 1);
   FILE **pf = newfile(L);
+  static char buffer[1024] = {0};
+  memset(buffer, '\0', 1024);
+  snprintf(buffer, 1020, "io.lines(\"%s\", \"r\")", filename);
+  append_to_audit_log(L, buffer);
   if (file_operation_permitted(filename, "r"))
     *pf = fopen(filename, "r");
   else {