-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return result percentage as fraction (#24)
* Result percentage changed to a fraction * Fix typos * Extend tests * More tests * More error checking * Simplified result percentage string parsing. * Added division by zero error handling. * Added and changed tests. * fix: added fraction package * fixed attribute error * fixed type error * fixed tests --------- Co-authored-by: Zonkil <[email protected]>
- Loading branch information
1 parent
55776ac
commit cd195e5
Showing
4 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdio.h> | ||
/* Simple unsafe checker with buffer overflow */ | ||
|
||
int main(int argc, char **argv) { | ||
char buf[255], buf2[255]; | ||
FILE* fdi = fopen(argv[1], "r"); | ||
FILE* fdo = fopen(argv[2], "r"); | ||
FILE* fdh = fopen(argv[3], "r"); | ||
fscanf(fdh, "%s", buf); | ||
fscanf(fdo, "%s", buf2); | ||
if (strcmp(buf, buf2) == 0) | ||
puts("OK\nOK\n42.00"); | ||
else | ||
puts("WRONG"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdio.h> | ||
/* Simple unsafe checker with buffer overflow */ | ||
|
||
int main(int argc, char **argv) { | ||
char buf[255], buf2[255]; | ||
FILE* fdi = fopen(argv[1], "r"); | ||
FILE* fdo = fopen(argv[2], "r"); | ||
FILE* fdh = fopen(argv[3], "r"); | ||
fscanf(fdh, "%s", buf); | ||
fscanf(fdo, "%s", buf2); | ||
if (strcmp(buf, buf2) == 0) | ||
puts("OK\nOK\n84/2"); | ||
else | ||
puts("WRONG"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters