From c79c2b6b2aa7b8d259044bc9f90c0eee16a9bc0a Mon Sep 17 00:00:00 2001 From: Oskar Date: Sun, 19 Nov 2023 16:57:23 +0100 Subject: may or may not have fixed a bug with GET_LINE(), i did some confirmation testing after i fixed the bug and it seems to work now but i may just be coping. Ill have to do additional tests to confirm that nothing else broke or if i might have missed anything. Its entirely possible i may have missed something --- functions.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'functions.c') diff --git a/functions.c b/functions.c index e5837b7..edba69b 100644 --- a/functions.c +++ b/functions.c @@ -156,7 +156,7 @@ int GET_LINE(char filename[], long focus, char **line, size_t *start) { // Makin c1_count++; } } // checks how many characters are in the first line - char c1buf[c1_count]; + char c1buf[c1_count+1]; fseek(file, 0, SEEK_SET); int i = 0; @@ -207,7 +207,7 @@ int GET_LINE(char filename[], long focus, char **line, size_t *start) { // Makin } fseek(file, save_i+1, SEEK_SET); - char c2buf[c2_count]; + char c2buf[c2_count+1]; int i = 0; for (; i < c2_count ; i++) { c2buf[i] = fgetc(file); @@ -223,4 +223,4 @@ int GET_LINE(char filename[], long focus, char **line, size_t *start) { // Makin fclose(file); return 0; -} \ No newline at end of file +} -- cgit v1.2.3