diff --git a/dsoextractfw/ChangeLog b/dsoextractfw/ChangeLog index 250b283..7722661 100644 --- a/dsoextractfw/ChangeLog +++ b/dsoextractfw/ChangeLog @@ -5,4 +5,7 @@ 2010-08-16 Oliver Haag * Version 0.6.1: -* USB-devices can be used by any user in the plugdev group now \ No newline at end of file +* USB-devices can be used by any user in the plugdev group now + +2010-08-20 Oliver Haag +* Added checking for End of File Record to the hex-writing routine \ No newline at end of file diff --git a/dsoextractfw/dsoextractfw.c b/dsoextractfw/dsoextractfw.c index fee2599..57e0aab 100644 --- a/dsoextractfw/dsoextractfw.c +++ b/dsoextractfw/dsoextractfw.c @@ -2,7 +2,7 @@ // // OpenHantek // dsoextractfw.c -// Copyright (C) 2008, 2009 Oleg Khudyakov +// Copyright (C) 2008 Oleg Khudyakov // prcoder@potrebitel.ru // Copyright (C) 2010 Oliver Haag // oliver.haag@gmail.com @@ -39,28 +39,35 @@ int extractFirmware(const char* model); int writeSRecords(const char *filename, unsigned char *ptr, bfd_size_type len) { - unsigned char n, *p, crc=0; + unsigned char n, *p, crc=0, eof; bfd_size_type i, t; FILE *f; - + if ((f=fopen(filename, "wt")) == NULL) { perror("Cant' open file for writing"); fclose(f); return -1; } - + for(t=0; t