Commit a1e75782 authored by Julian Kranz's avatar Julian Kranz

Portability: Removed call to __fpurge()

parent 850b46f8
......@@ -22,7 +22,7 @@ size_t readhex_hex_read(FILE *f, uint8_t **buffer) {
if(feof(f))
goto end_read;
char next = getc(f);
if(next == '\n')
if(next == '\n' && length)
goto end_read;
if(length_str && !target[length_str - 1] && next == 'x') {
length_str--;
......
......@@ -6,7 +6,6 @@
*/
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <stdint.h>
#include <readhex.h>
......@@ -39,7 +38,7 @@ int main(int argc, char** argv) {
printf("Using backend %s...\n", backends[backend_ind]);
__fpurge(stdin);
// __fpurge(stdin);
uint8_t *buffer;
size_t size = readhex_hex_read(stdin, &buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment