Skip to content

Commit

Permalink
docs: update CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cezelot committed Aug 16, 2024
1 parent bcab699 commit f676afe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fix `Complex Method` issue in input_3.c (#4).
- Fix `Bumpy Road` issue in file_io.c (#5).

## [0.4.0] - 2024-07-24

Expand Down
2 changes: 1 addition & 1 deletion sources/file_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void save(t_env *env)
int fd;

if (env->filename == NULL && set_filename(env) == -1)
return;
return ;
buf = rows_to_string(env, &len);
fd = open_save_file(env, buf);
if (fd == -1)
Expand Down
4 changes: 2 additions & 2 deletions sources/input/input_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
/* Sort the keymap using the quicksort algorithm. */
static void quicksort_keymap(t_key_map *keymap, int start, int end)
{
if (start >= end)
if (start >= end)
return ;
int pivot = keymap[end].key;
int idx = start;

for (int i = start; i < end; ++i) {
if (keymap[i].key < pivot) {
t_key_map tmp = keymap[i];
Expand Down
6 changes: 3 additions & 3 deletions sources/save_file_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
void cleanup(int fd, char *buf)
{
if (fd != -1) close(fd);
if (buf != NULL) {
if (buf != NULL)
{
free(buf);
buf = NULL;
}
Expand All @@ -48,10 +49,9 @@ int set_filename(t_env *env)

int open_save_file(t_env *env, char *buf)
{
int fd = open(env->filename, O_RDWR | O_CREAT, 0644);
int fd = open(env->filename, O_RDWR | O_CREAT, 0644);
if (fd == -1)
{

set_status_message(env, "Unable to save: %s", strerror(errno));
cleanup(fd, buf);
}
Expand Down

0 comments on commit f676afe

Please sign in to comment.