Skip to content

Commit

Permalink
Merge pull request #44 from jkoeppeler/fix-off-by-one-assert
Browse files Browse the repository at this point in the history
chp4: c_snippet: fix assert statement
  • Loading branch information
tnballo committed Jan 27, 2024
2 parents f86c855 + aa18fbe commit e35cb62
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code_snippets/chp4/c_snippets/spatial.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ char* get_greeting() {
return NULL;
} else {
strncpy(greeting, "Hello", 6);
assert(greeting[6] == '\0');
assert(greeting[5] == '\0');
return greeting;
}
}
Expand Down
2 changes: 1 addition & 1 deletion code_snippets/chp4/c_snippets/temporal.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ char* get_greeting() {
return NULL;
} else {
strncpy(greeting, "Hello", 6);
assert(greeting[6] == '\0');
assert(greeting[5] == '\0');
return greeting;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/chp1/about_the_team.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Listed alphabetically:
* [humb1t](https://github.com/humb1t)
* [jam1garner](https://github.com/jam1garner)
* [jamesreprise](https://github.com/jamesreprise)
* [jkoeppeler](https://github.com/jkoeppeler)
* [kaylynn234](https://github.com/kaylynn234)
* [LoganDark](https://github.com/LoganDark)
* [Michcioperz](https://github.com/Michcioperz)
Expand Down
2 changes: 1 addition & 1 deletion src/chp4/attack_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ char* get_greeting() {
return NULL;
} else {
strncpy(greeting, "Hello", 6);
assert(greeting[6] == '\0');
assert(greeting[5] == '\0');
return greeting;
}
}
Expand Down

0 comments on commit e35cb62

Please sign in to comment.