nserver

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit e38f0dbadd2e4fef15ecfbc746c29b42a478b65d
parent 35205c4ea57129cb2c89d44aef4bad0f4fd88f62
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 26 Nov 2019 17:44:47 -0500

nserver: Update check_cmd_size.

* nserver/src/nserve.c (check_cmd_size): Use barfsock to send error to
socket.

Diffstat:
nserver/src/nserve.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/nserver/src/nserve.c b/nserver/src/nserve.c @@ -36,9 +36,8 @@ int check_cmd_size(char *cmd, int sock) } char *err = "error: command invalid: size > 120 characters\n"; - ssize_t err_sz = strlen(err); - ssize_t bytes = send(sock, err, err_sz, 0); - check(bytes == err_sz, "check_cmd_size: send failed"); + size_t bytes = barfsock(err, strlen(err), sock); + check(bytes == strlen(err), "check_cmd_size: send failed"); return 1; error: