kore

Kore is a web application platform for writing scalable, concurrent web based processes in C or Python.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 5b8c880a62948d59eb99973db187f4ba063026a0
parent 6495e84005fd54729b60296019828d6e7dab0d3a
Author: Joris Vink <joris@coders.se>
Date:   Fri,  1 Aug 2014 20:25:02 +0200

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

Diffstat:
src/cli.c | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/cli.c b/src/cli.c @@ -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");