diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-05-29 20:10:01 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2025-05-29 20:10:01 -0400 |
| commit | 5b05099d44ae6ac962be108f4c0da7493a9305c7 (patch) | |
| tree | 1b796b3ff1491e83f26c9ba09fd6c48feac7c994 /src/hello.c | |
Diffstat (limited to 'src/hello.c')
| -rw-r--r-- | src/hello.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/hello.c b/src/hello.c new file mode 100644 index 0000000..b69ccdf --- /dev/null +++ b/src/hello.c @@ -0,0 +1,20 @@ +#include <stdio.h> +#include <stdbool.h> +#include <string.h> +#include "io.h" + +int main(void) { + char buffer[BUFSIZ] = {0}; + if (!ReadFile("version.txt", BUFSIZ, buffer)) { + return -1; + } + + char *b = strrchr(buffer, '\n'); + if (b != NULL) { + *b = '\0'; + } + + printf("Hello %s\n", buffer); + return 0; +} + |
