nserver

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

commit 35205c4ea57129cb2c89d44aef4bad0f4fd88f62
parent 615a9c9bdb4c9a93c3eb6354b06533831070eddc
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu, 21 Nov 2019 21:26:11 -0500

nserver: Update check_cmd_size.

* nserver/src/nserve.c (check_cmd_size): Add check for the send call.

Diffstat:
nserver/src/nserve.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

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