Module Name:    src
Committed By:   lukem
Date:           Sun Jun 21 14:11:54 UTC 2020

Modified Files:
        src/external/bsd/lutok/dist: state.cpp

Log Message:
lutok; fix strncpy -Wstringop-truncation warning


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/lutok/dist/state.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/lutok/dist/state.cpp
diff -u src/external/bsd/lutok/dist/state.cpp:1.1.1.2 src/external/bsd/lutok/dist/state.cpp:1.2
--- src/external/bsd/lutok/dist/state.cpp:1.1.1.2	Fri Oct 18 23:35:24 2013
+++ src/external/bsd/lutok/dist/state.cpp	Sun Jun 21 14:11:54 2020
@@ -145,7 +145,7 @@ call_cxx_function_from_c(lutok::cxx_func
         lutok::state state = lutok::state_c_gate::connect(raw_state);
         return function(state);
     } catch (const std::exception& e) {
-        std::strncpy(error_buf, e.what(), sizeof(error_buf));
+        std::strncpy(error_buf, e.what(), sizeof(error_buf)-1);
     } catch (...) {
         std::strncpy(error_buf, "Unhandled exception in Lua C++ hook",
                      sizeof(error_buf));

Reply via email to