Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: voidbert/LI3
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: Fase2
Choose a base ref
...
head repository: voidbert/LI3
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Feb 17, 2024

  1. Fix some query segfaults

     - A dataset loading failure would still allow the user to run queries;
     - Queries with invalid arguments would fail to be freed in interactive
       mode;
    voidbert committed Feb 17, 2024
    Copy the full SHA
    d1463f3 View commit details
  2. Add project grade

    voidbert committed Feb 17, 2024
    Copy the full SHA
    4f70fba View commit details
Showing with 11 additions and 1 deletion.
  1. +7 −0 README.md
  2. +3 −0 trabalho-pratico/src/interactive_mode/interactive_mode.c
  3. +1 −1 trabalho-pratico/src/queries/query_instance.c
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@
Project for our LI3 class. See [Requirements.pdf](Requirements.pdf) (in Portuguese) to see the
project's requirements.

### Grade

**Final grade**: 20 / 20 🤩

- 1st phase: 20.0 / 20.0
- 2nd phase: 19.6 / 20.0

## Building

### Dependencies
3 changes: 3 additions & 0 deletions trabalho-pratico/src/interactive_mode/interactive_mode.c
Original file line number Diff line number Diff line change
@@ -82,6 +82,7 @@ void __interactive_mode_load_dataset(database_t **database) {

*database = database_create();
if (!*database) {
*database = NULL;
activity_messagebox_run("Failed to allocate new database!");
free(path);
return;
@@ -90,6 +91,8 @@ void __interactive_mode_load_dataset(database_t **database) {
/* Load new dataset */
if (dataset_loader_load(*database, path, NULL, NULL)) {
activity_messagebox_run("Failed to load dataset! Old data has been discarded.");
database_free(*database);
*database = NULL;
} else {
activity_messagebox_run("Dataset loaded successfully!");
}
2 changes: 1 addition & 1 deletion trabalho-pratico/src/queries/query_instance.c
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ const void *query_instance_get_argument_data(const query_instance_t *query) {
}

void query_instance_free(query_instance_t *query) {
if (query->type) {
if (query->type && query->argument_data) {
const query_type_free_arguments_callback_t free_cb =
query_type_get_free_arguments_callback(query->type);
free_cb(query->argument_data);