Skip to content

Commit d8f97c1

Browse files
committed
Avoid implicit conversion to bool and actually use return value
The function was declared to return a bool (that was never read) and did so from a function call returning an int. Make conversion explicit and actually test on that return value.
1 parent 62280d2 commit d8f97c1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/goto-programs/osx_fat_reader.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ bool osx_fat_readert::extract_gb(
8888
{
8989
PRECONDITION(has_gb_arch);
9090

91-
return run("lipo", {"lipo", "-thin", "hppa7100LC", "-output", dest, source});
91+
return run(
92+
"lipo", {"lipo", "-thin", "hppa7100LC", "-output", dest, source}) !=
93+
0;
9294
}

src/goto-programs/read_goto_binary.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ bool read_goto_binary(
135135
if(osx_fat_reader.has_gb())
136136
{
137137
temporary_filet tempname("tmp.goto-binary", ".gb");
138-
osx_fat_reader.extract_gb(filename, tempname());
138+
if(osx_fat_reader.extract_gb(filename, tempname()))
139+
{
140+
message.error() << "failed to extract goto binary" << messaget::eom;
141+
return true;
142+
}
139143

140144
std::ifstream temp_in(tempname(), std::ios::binary);
141145
if(!temp_in)

0 commit comments

Comments
 (0)