From 955b1284888e877d405241952a367d8b20dfba26 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Wed, 8 Jul 2026 16:14:02 +0200 Subject: Make tests more strict --- src/system.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system.c b/src/system.c index ccb7ccd..722f67c 100644 --- a/src/system.c +++ b/src/system.c @@ -141,7 +141,7 @@ char *edit(const char *initial_content) tmp_fd = mkstemp(tmp_file); sys_check(tmp_fd != -1, "mkstemp"); rc = write(tmp_fd, initial_content, strlen(initial_content)); - sys_check(rc != -1, "write"); + sys_check(rc = strlen(initial_content), "write"); env_editor = getenv("EDITOR"); if (env_editor) strbuild(editor_cmd, "%s %s", env_editor, tmp_file); @@ -164,7 +164,7 @@ char *file_to_string(int fd) sys_check(rc != -1, "stat"); content = malloc(st.st_size + 1); rc = read(fd, content, st.st_size); - sys_check(rc != -1, "read"); + sys_check(rc == st.st_size, "read"); content[st.st_size] = '\0'; return content; } -- cgit v1.2.3