This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
13 additions
and
12 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef FORMAT_H | ||
#define FORMAT_H | ||
#ifndef FORMAT_STRING_H | ||
#define FORMAT_STRING_H | ||
|
||
char* format(char *in); | ||
char* format_string(char *in); | ||
|
||
#endif |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include "format_string.h" | ||
|
||
int main() { | ||
char in [30]; | ||
strcpy(in, "This is a <test> & example."); | ||
printf("%s\n", format(in)); | ||
printf("%s\n", format_string(in)); | ||
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
add_executable(format_string_test format_string_test.c) | ||
target_link_libraries(format_string_test format_string) | ||
target_link_libraries(format_string_test format) | ||
target_compile_options(format_string_test PRIVATE -fsanitize=address) | ||
target_link_options(format_string_test PRIVATE -fsanitize=address) | ||
add_test(NAME format_string_test COMMAND format_string_test) | ||
|
||
add_executable(fuzz_test fuzz_test.c) | ||
target_link_libraries(fuzz_test fuzz) | ||
target_compile_options(fuzz_test PRIVATE -fsanitize=address,fuzzer) | ||
target_link_options(fuzz_test PRIVATE -fsanitize=address,fuzzer) | ||
target_compile_options(fuzz_test PRIVATE -fsanitize=fuzzer,address) | ||
target_link_options(fuzz_test PRIVATE -fsanitize=fuzzer,address) |