diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2026-07-08 16:14:02 +0200 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2026-07-08 16:14:02 +0200 |
| commit | 955b1284888e877d405241952a367d8b20dfba26 (patch) | |
| tree | a8e935e120cff205e21aed1fe721f084d94d1205 /src | |
| parent | 9b4d346d7d5831a2db2da9335509bd93b69e0840 (diff) | |
Make tests more strict
Diffstat (limited to 'src')
| -rw-r--r-- | src/system.c | 4 |
1 files 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; } |
