summaryrefslogtreecommitdiff
path: root/src/hello.c
diff options
context:
space:
mode:
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;
+}
+