sds

simple/sensor data server
git clone git://git.hanetzok.net/sds
Log | Files | Refs | README | LICENSE

commit c1a3efaab7300eaf4907cd90f4e01e8c3032eaf4
parent 96c4299799dc7613094b3fe82b3e3b46ab296fcc
Author: Markus Hanetzok <markus@hanetzok.net>
Date:   Sat,  6 Jul 2024 03:03:05 +0200

simplify strcmp call

Diffstat:
Msds.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sds.c b/sds.c @@ -80,7 +80,7 @@ void writeresponse(char response[], int clientfd, size_t responselen) { } int main(int argc, char *argv[]) { - if (argc < 3 || strcmp(argv[1], "-p") != 0) + if (argc < 3 || strcmp(argv[1], "-p")) die("usage: mts [-p PORT]"); char response[BUFFER_SIZE]; int sockfd = socket(AF_INET, SOCK_STREAM, 0); @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) { memset(response, 0, BUFFER_SIZE); - if (strcmp("GET", method) != 0) { + if (strcmp("GET", method)) { printf("%s\n", uri); snprintf(response + strlen(response), BUFFER_SIZE - strlen(response), "%s%s", NOTALLOWED_HEADER, "<html>method not allowed</html>");