summaryrefslogtreecommitdiff
path: root/src/hello.c
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2025-05-29 20:10:01 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2025-05-29 20:10:01 -0400
commit5b05099d44ae6ac962be108f4c0da7493a9305c7 (patch)
tree1b796b3ff1491e83f26c9ba09fd6c48feac7c994 /src/hello.c
Initial CommitHEADmain
Diffstat (limited to 'src/hello.c')
-rw-r--r--src/hello.c20
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;
+}
+