Fix Pocketbook crashes when filename is nil (#8823)

Function `SetSubtaskInfo` takes only chars as a valid book. Since
filename can be `nil` (not a char) the crash would happen. This
Change avoids the crash by using a char type nil value. See:

`int SetSubtaskInfo(int task, int subtask, const char *name, const char *book);`

Fixes #8053
Fixes #8392 too
Fixes #8743 last issue
reviewable/pr8863/r1
Robert-Jan de Dreu 2 years ago committed by GitHub
parent d2ee9d8d4e
commit 41e57fccd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,7 @@ local C = ffi.C
local inkview = ffi.load("inkview")
local band = require("bit").band
local util = require("util")
local _ = require("gettext")
require("ffi/posix_h")
require("ffi/linux_input_h")
@ -268,7 +269,7 @@ function PocketBook:notifyBookState(title, document)
fo:write(fn)
fo:close()
end
inkview.SetSubtaskInfo(inkview.GetCurrentTask(), 0, title and (title .. " - koreader") or "koreader", fn)
inkview.SetSubtaskInfo(inkview.GetCurrentTask(), 0, title and (title .. " - koreader") or "koreader", fn or _("N/A"))
end
function PocketBook:setDateTime(year, month, day, hour, min, sec)

Loading…
Cancel
Save