diff options
author | bpc2003 <wpesfriendnva@gmail.com> | 2025-03-06 14:48:55 -0500 |
---|---|---|
committer | bpc2003 <wpesfriendnva@gmail.com> | 2025-03-06 14:48:55 -0500 |
commit | cf36cda36f8e91290f1d765f24c7933d4fadd837 (patch) | |
tree | 462df036f21dcd2634256b0637e620fac1dd3e63 /src/main.c | |
parent | 575b17b4126baa1025700107ae67e5729935189a (diff) |
Got started on readfile
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..8e4bab4 --- /dev/null +++ b/src/main.c @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> + +#include "include/fileops.h" + +int main(int argc, char **argv) +{ + if (argc != 2) + exit(1); + char *filename = argv[1]; + + uint8_t *buf = readdb(filename); + if (buf == NULL) + exit(0); + + printf("[ "); + for (int i = 0; buf[i]; ++i) { + printf("%d ", buf[i]); + } + printf("]\n"); + free(buf); + exit(0); +} |