Skip to content
Snippets Groups Projects
Commit 64c7d061 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix #700: Crash on calling log.info() with formatting characters

parent eaa52dd4
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ local function say(level, fmt, ...)
file = 'eval'
end
end
ffi.C._say(level, file, line, nil, str)
ffi.C._say(level, file, line, nil, "%s", str)
end
return {
......
Hello, World!
TAP version 13
1..2
ok - message
ok - formatting
#!/usr/bin/env tarantool
local test = require('tap').test('log')
test:plan(2)
--
-- Check that Tarantool creates ADMIN session for #! script
--
......@@ -16,7 +19,16 @@ while file:read() do
end
log.info(message)
local line = file:read()
print(line:sub(-message:len()))
test:is(line:sub(-message:len()), message, "message")
--
-- gh-700: Crash on calling log.info() with formatting characters
--
log.info("gh-700: %%s %%f %%d")
test:is(file:read():match('I>%s+(.*)'), "gh-700: %s %f %d", "formatting")
file:close()
log.rotate()
test:check()
os.exit()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment