Skip to content

Commit 2143999

Browse files
committed
fixup file read mode
1 parent f6ca521 commit 2143999

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

MIDAS/src/hilsim/stream/main.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int main(int argc, char** argv) {
175175
sscanf(_inbuf + 1, " %s", &inbuf);
176176

177177
printf("LOAD %s\n", inbuf);
178-
inptr = fopen(inbuf, "r");
178+
inptr = fopen(inbuf, "rb");
179179

180180
if (inptr == NULL) {
181181
std::cerr << "Error opening file " << inbuf << std::endl;
@@ -213,13 +213,12 @@ int main(int argc, char** argv) {
213213
for(int a = 0; a < n; a++) {
214214
if(read_entry(entry)) {
215215
printf("DEBUG ENTRY [%u]: (%u) <size: %uB> (CRC 0x%x)\n", entry.ts, entry.disc, entry._data_size, entry.crc);
216-
fflush(stdin);
217216
}
218217
}
219218
} else {
220219
std::cerr << "No file specified" << std::endl;
221220
}
222-
fflush(stdin);
221+
fflush(stdout);
223222
break;
224223
case 's':
225224
// s(tream) -- stream all data to com port as fast as possible

0 commit comments

Comments
 (0)