diff options
author | Oskar <[email protected]> | 2023-11-19 16:57:23 +0100 |
---|---|---|
committer | Oskar <[email protected]> | 2023-11-19 16:57:23 +0100 |
commit | c79c2b6b2aa7b8d259044bc9f90c0eee16a9bc0a (patch) | |
tree | 3d7c2cc8b93e8583e1faea14b510166ec52d1fe6 /functions.c | |
parent | 6a6a4adf561d4a3a35df2fc5517dc4d253006809 (diff) |
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
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 +} |