projects
/
emu8051.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc6633f
)
Move macro definition to top of file
author
Hugo Villeneuve
<hugo@hugovil.com>
Sun, 26 Jan 2014 20:28:36 +0000
(15:28 -0500)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Sun, 26 Jan 2014 20:38:55 +0000
(15:38 -0500)
src/common/hexfile.c
patch
|
blob
|
history
diff --git
a/src/common/hexfile.c
b/src/common/hexfile.c
index
c879c89
..
80a0aac
100644
(file)
--- a/
src/common/hexfile.c
+++ b/
src/common/hexfile.c
@@
-36,6
+36,9
@@
#include "common.h"
#include "memory.h"
#include "common.h"
#include "memory.h"
+/* Maximum of 75 digits with 32-bytes data records. */
+#define HEXFILE_LINE_BUFFER_LEN 128
+
/* Convert integer to ASCII hex string. */
void
int2asciihex(int val, char *str, int width)
/* Convert integer to ASCII hex string. */
void
int2asciihex(int val, char *str, int width)
@@
-96,11
+99,9
@@
void
LoadHexFile(const char *filename)
{
int i, j, RecLength, LoadOffset, RecType, Data, Checksum;
LoadHexFile(const char *filename)
{
int i, j, RecLength, LoadOffset, RecType, Data, Checksum;
-
-#define LINE_BUFFER_LEN 256
FILE *fp;
int status;
FILE *fp;
int status;
- char line[LINE_BUFFER_LEN];
+ char line[
HEXFILE_
LINE_BUFFER_LEN];
if (filename == NULL)
log_fail("No file specified");
if (filename == NULL)
log_fail("No file specified");
@@
-117,7
+118,7
@@
LoadHexFile(const char *filename)
stored into the buffer. A '\0' is stored after the last character
in the buffer.
*/
stored into the buffer. A '\0' is stored after the last character
in the buffer.
*/
- while (fgets(line, LINE_BUFFER_LEN, fp) != NULL) {
+ while (fgets(line,
HEXFILE_
LINE_BUFFER_LEN, fp) != NULL) {
i = 0;
Checksum = 0;
i = 0;
Checksum = 0;