From 0846a40229ad8753419a0ab8a303d3a293df305e Mon Sep 17 00:00:00 2001 From: la-ninpre Date: Thu, 22 Jul 2021 07:23:54 +0000 Subject: added missing error check to main and fixed error message in cgi FossilOrigin-Name: e4d3b7cc592ac6f4eb64c16d4c24e88b04a1e5efe4aff54f6d9c48ac0a723eac --- cgi.c | 2 +- main.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cgi.c b/cgi.c index 0e67715..1e983a9 100644 --- a/cgi.c +++ b/cgi.c @@ -78,7 +78,7 @@ main(void) char *ns; ns = nimi_sewi(); if (ns == NULL) { - err(EXIT_FAILURE, "memory could'n be allocated"); + err(EXIT_FAILURE, "memory allocation failed"); } print_response_header(); diff --git a/main.c b/main.c index e254220..2aa851b 100644 --- a/main.c +++ b/main.c @@ -36,8 +36,12 @@ main(void) err(EXIT_FAILURE, "pledge"); } #endif + char *ns; ns = nimi_sewi(); + if (ns == NULL) { + err(EXIT_FAILURE, "memory allocation failed"); + } printf("%s\n", ns); -- cgit v1.2.3