Skip to content

Commit

Permalink
tidy: Explicitly check file size in previewgenerator.cpp.
Browse files Browse the repository at this point in the history
The clang-tidy "implicit boolean conversion" check pointed out a spot
where a file size was implicitly converted to a boolean value.  Fix to
explicitly test to see if the file is non-zero in length.  Changes
made by the clang-tidy program.

https://clang.llvm.org/extra/clang-tidy/checks/readability-implicit-bool-conversion.html
  • Loading branch information
linuxdude42 committed Apr 3, 2019
1 parent e9620c6 commit bc18e0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/previewgenerator.cpp
Expand Up @@ -292,7 +292,7 @@ bool PreviewGenerator::Run(void)
}

QFileInfo fi(outname);
ok = (fi.exists() && fi.isReadable() && fi.size());
ok = (fi.exists() && fi.isReadable() && (fi.size() != 0));
if (ok)
{
LOG(VB_PLAYBACK, LOG_INFO, LOC + "Preview process ran ok.");
Expand Down

0 comments on commit bc18e0c

Please sign in to comment.