Skip to content

Commit

Permalink
Fix if statement based off of uninitialized memory in part3
Browse files Browse the repository at this point in the history
  • Loading branch information
nilesr committed Apr 7, 2019
1 parent 02a1a79 commit 84d1ede
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _parts/part3.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Lastly, we need to initialize the table and handle a few more error cases:

```diff
+ Table* new_table() {
+ Table* table = malloc(sizeof(Table));
+ Table* table = calloc(sizeof(Table));
+ table->num_rows = 0;
+
+ return table;
Expand Down Expand Up @@ -334,7 +334,7 @@ We'll address those issues in the next part. For now, here's the complete diff f
+}
+
+Table* new_table() {
+ Table* table = malloc(sizeof(Table));
+ Table* table = calloc(sizeof(Table));
+ table->num_rows = 0;
+
+ return table;
Expand Down Expand Up @@ -426,4 +426,4 @@ We'll address those issues in the next part. For now, here's the complete diff f
+ }
}
}
```
```

0 comments on commit 84d1ede

Please sign in to comment.