nserver

nihilistic stats server
Log | Files | Refs | README | LICENSE

commit 95b5fc0e639e291c44dcdf0c48cce1b63172b52c
parent 2bba76d1984385a2dfb47aca205903cbe2e07560
Author: rsiddharth <s@ricketyspace.net>
Date:   Sat, 18 Apr 2020 22:24:58 -0400

ncmd.c: Update check_cmd.

* src/ncmd.c (check_cmd): Change error message when command is
invalid.
* tests/ncmd_tests.c (test_check_cmd): Update test.

Diffstat:
src/ncmd.c | 2+-
tests/ncmd_tests.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ncmd.c b/src/ncmd.c @@ -42,7 +42,7 @@ int check_cmd(char *cmd, char *err) strncpy(err, "closing connection\n", RSP_SIZE); return -1; } else { - strncpy(err, "command size invalid\n", RSP_SIZE); + strncpy(err, "invalid command\n", RSP_SIZE); return -1; } diff --git a/tests/ncmd_tests.c b/tests/ncmd_tests.c @@ -81,7 +81,7 @@ char *test_check_cmd() rc = check_cmd(cmd, err); mu_assert(rc < 0, "check_cmd failed"); - mu_assert(strcmp(err, "command size invalid\n") == 0, + mu_assert(strcmp(err, "invalid command\n") == 0, "wrong err msg"); memset(err, '\0', RSP_SIZE);