diff --git a/backend/Makefile b/backend/Makefile index f62cbd7..d93c067 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -15,10 +15,10 @@ C_FLAGS = \ -std=c17 \ -Wall -Wextra -Wpedantic -Wconversion \ -pedantic -pedantic-errors \ - -Wno-unused-parameter \ + -Wno-unused-parameter -Wno-format-zero-length \ L_FLAGS = -lm -pthread $(shell pkg-config sqlite3 openssl --libs) -C_FLAGS = $(shell pkg-config sqlite3 openssl --cflags) +C_FLAGS += $(shell pkg-config sqlite3 openssl --cflags) F_FLAGS = OPTIMIZATION = diff --git a/backend/compile_flags.txt b/backend/compile_flags.txt index 482caa8..32f238a 100644 --- a/backend/compile_flags.txt +++ b/backend/compile_flags.txt @@ -1,4 +1,4 @@ -xc +-xc -std=c17 -Wall -Wextra diff --git a/backend/src/http_server.c b/backend/src/http_server.c index 0d254ea..873bcfb 100644 --- a/backend/src/http_server.c +++ b/backend/src/http_server.c @@ -183,7 +183,11 @@ void http_ctx_respond(HttpCtx* ctx, int status, const char* body) string_push_str(&res, body); - write(ctx->client->file, res.data, res.size); + ssize_t bytes_written = write(ctx->client->file, res.data, res.size); + if (bytes_written != (ssize_t)res.size) { + fprintf(stderr, "error: could not send response\n"); + } + puts("\nResponse:"); puts(res.data); diff --git a/backend/src/panic.h b/backend/src/panic.h index d80ec2f..e6d26e7 100644 --- a/backend/src/panic.h +++ b/backend/src/panic.h @@ -7,7 +7,7 @@ (fputs("\x1b[1;31mpanic\x1b[97m: ", stderr), fprintf(stderr, __VA_ARGS__), \ fprintf(stderr, "\x1b[0m\n\tin %s:%d\n\tat %s:%d\n", __func__, \ __LINE__, __FILE__, __LINE__), \ - exit(1), 0) + exit(1), (void)0) __attribute__((unused)) static inline void ___include_user(void) {