Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ test:
install: default
meson install -C src/builddir

[working-directory: 'src']
generate-llvm: clean
clang -g -Wall -S -emit-llvm -std=gnu23 *.c
llvm-link -S -v *.ll -o icscli.ll

[working-directory: 'src']
llvm-to-binary: generate-llvm
clang icscli.ll -o icscli -luuid

clean:
rm -rf src/builddir
rm -rf unit_tests/builddir
rm -f src/*.ll
rm -f src/icscli
3 changes: 2 additions & 1 deletion src/file_handling.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ void read_until_string(int fd, char buffer[], char search_string[]) {
i++;
}
size_t truncate_position = strlen(buffer) - strlen(search_string);
memset(&buffer[truncate_position], '\0', truncate_position);

memset(&buffer[truncate_position], '\0', strlen(buffer) - truncate_position);
}

// Seeks for a string in an open file.
Expand Down