From 7d8c71019c111134c15a7903ec9acfb5713755fe Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 28 Dec 2015 22:45:45 +0100 Subject: partially implement satd-list, satd-rm, and satd-run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/daemon.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/daemon.c') diff --git a/src/daemon.c b/src/daemon.c index 8d9b1b3..b47e4d2 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -41,7 +41,7 @@ * @throws Any exception specified for realloc(3). */ int -readall(int fd, char **buf, size_t *n); +readall(int fd, char **buf, size_t *n) { char *buffer = NULL; size_t ptr = 0; @@ -54,7 +54,7 @@ readall(int fd, char **buf, size_t *n); if (ptr == size) { new = realloc(buffer, size <<= 1); t (!new); - buffer = wnew; + buffer = new; } got = read(fd, buffer + ptr, size - ptr); t (got < 0); @@ -90,10 +90,9 @@ fail: * @throws Any exception specified for realloc(3). */ char ** -restore_array(char* buf, size_t len, size_t* n) +restore_array(char *buf, size_t len, size_t *n) { char **rc = malloc((len + 1) * sizeof(char*)); - char *elem = NULL; char **new; size_t i, e = 0; t (!rc); -- cgit v1.2.3-70-g09d2