summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/tools/lua/hwlib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/tools/lua/hwlib.lua')
-rw-r--r--utils/hwstub/tools/lua/hwlib.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/hwstub/tools/lua/hwlib.lua b/utils/hwstub/tools/lua/hwlib.lua
index 5bbd1e2668..02ab9718d4 100644
--- a/utils/hwstub/tools/lua/hwlib.lua
+++ b/utils/hwstub/tools/lua/hwlib.lua
@@ -22,6 +22,8 @@ function HWLIB.load_blob(filename, address)
io.close(f)
end
-function HWLIB.printf(s,...)
- return io.write(s:format(...))
+function HWLIB.printf(...)
+ local function wrapper(...) io.write(string.format(...)) end
+ local status, result = pcall(wrapper, ...)
+ if not status then error(result, 2) end
end