mirror of https://git.kore.io/kore.git
Don't write the static output to a tmp buf, just write it to disk
This commit is contained in:
parent
6495e84005
commit
5b8c880a62
|
@ -461,7 +461,6 @@ cli_build_static(char *fpath, struct dirent *dp)
|
||||||
u_int8_t *d;
|
u_int8_t *d;
|
||||||
struct cfile *cf;
|
struct cfile *cf;
|
||||||
off_t off;
|
off_t off;
|
||||||
struct kore_buf *buf;
|
|
||||||
void *base;
|
void *base;
|
||||||
int in, out;
|
int in, out;
|
||||||
char *cpath, *ext;
|
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. */
|
/* Copy all data into a buf and write it out afterwards. */
|
||||||
d = base;
|
d = base;
|
||||||
buf = kore_buf_create(st.st_size);
|
|
||||||
for (off = 0; off < st.st_size; off++)
|
for (off = 0; off < st.st_size; off++)
|
||||||
kore_buf_appendf(buf, "0x%02x,", *d++);
|
cli_file_writef(out, "0x%02x,", *d++);
|
||||||
cli_file_write(out, buf->data, buf->offset);
|
|
||||||
kore_buf_free(buf);
|
|
||||||
|
|
||||||
/* Add the meta data. */
|
/* Add the meta data. */
|
||||||
cli_file_writef(out, "};\n\n");
|
cli_file_writef(out, "};\n\n");
|
||||||
|
|
Loading…
Reference in New Issue