X-Git-Url: https://git.realraum.at/?p=svn42.git;a=blobdiff_plain;f=door_daemon%2Fdoor_daemon.c;h=bddb28fc371209019d2a80421d47bed46718db1f;hp=e9bd2db577546997b48eb3c551d61763bdec4a6b;hb=4ee2501ff864b8e15202ee814e8bafcc0c2adf6c;hpb=9502757035c347a7ec1762e74e25889f85ecbdc1 diff --git a/door_daemon/door_daemon.c b/door_daemon/door_daemon.c index e9bd2db..bddb28f 100644 --- a/door_daemon/door_daemon.c +++ b/door_daemon/door_daemon.c @@ -111,7 +111,7 @@ int send_response(int fd, const char* response) int offset = 0; int ret; for(;;) { - ret = write(fd, &response[offset], strlen(response)); + ret = write(fd, &response[offset], len - offset); if(ret < 0) { if(errno != EINTR) return ret; @@ -431,7 +431,8 @@ int main_loop(int door_fd, int cmd_listen_fd) break; } - lst = lst->next; + if(lst) + lst = lst->next; } if(cmd_q && !cmd_q->sent)