fix more issues reported by coverity
This commit is contained in:
@@ -125,9 +125,11 @@ image_is_hdx(const wchar_t *s, int check_signature)
|
||||
f = plat_fopen((wchar_t *)s, L"rb");
|
||||
if (!f)
|
||||
return 0;
|
||||
fseeko64(f, 0, SEEK_END);
|
||||
if (fseeko64(f, 0, SEEK_END))
|
||||
fatal("image_is_hdx(): Error while seeking");
|
||||
filelen = ftello64(f);
|
||||
fseeko64(f, 0, SEEK_SET);
|
||||
if (fseeko64(f, 0, SEEK_SET))
|
||||
fatal("image_is_hdx(): Error while seeking");
|
||||
if (filelen < 44) {
|
||||
if (f != NULL)
|
||||
fclose(f);
|
||||
|
||||
@@ -530,7 +530,7 @@ zip_load(zip_t *dev, wchar_t *fn)
|
||||
if (fseek(dev->drv->f, dev->drv->base, SEEK_SET) == -1)
|
||||
fatal("zip_load(): Error seeking to the beginning of the file\n");
|
||||
|
||||
memcpy(dev->drv->image_path, fn, sizeof(dev->drv->image_path));
|
||||
wcsncpy(dev->drv->image_path, fn, sizeof_w(dev->drv->image_path));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user