From c32f7dd056a97fc322d1328c9c44d2e05d8bd7c6 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 4 Jun 2021 21:11:27 -0400 Subject: Added `find_line()`. Which finds the next line in the buffer. --- config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.c b/config.c index d1bdb10..a343448 100644 --- a/config.c +++ b/config.c @@ -56,6 +56,11 @@ char *read_file(const char *filename, long *size) { return buf; } +char *find_line(char *str) { + for (; *str != '\n' && *str != '\0'; str++); + return str; +} + config *parse_config(const char *filename) { /* Size of the file, in bytes. */ long filesize = 0; -- cgit v1.2.3-13-gbd6f