Don't write the static output to a tmp buf, just write it to disk

This commit is contained in:
Joris Vink 2014-08-01 20:25:02 +02:00
parent 6495e84005
commit 5b8c880a62
1 changed files with 1 additions and 5 deletions

View File

@ -461,7 +461,6 @@ cli_build_static(char *fpath, struct dirent *dp)
u_int8_t *d;
struct cfile *cf;
off_t off;
struct kore_buf *buf;
void *base;
int in, out;
char *cpath, *ext;
@ -495,11 +494,8 @@ cli_build_static(char *fpath, struct dirent *dp)
/* Copy all data into a buf and write it out afterwards. */
d = base;
buf = kore_buf_create(st.st_size);
for (off = 0; off < st.st_size; off++)
kore_buf_appendf(buf, "0x%02x,", *d++);
cli_file_write(out, buf->data, buf->offset);
kore_buf_free(buf);
cli_file_writef(out, "0x%02x,", *d++);
/* Add the meta data. */
cli_file_writef(out, "};\n\n");