Skip to content

Commit

Permalink
Increase maximum length of parsed lines in setupVars.conf to 100000
Browse files Browse the repository at this point in the history
  • Loading branch information
DL6ER committed Apr 14, 2017
1 parent 89f9e77 commit 055ce53
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setupVars.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Please see LICENSE file for your rights under this license. */

#include "FTL.h"
#define SETUPVARSLINELENGTH 100000

char ** setupVarsArray = NULL;

Expand Down Expand Up @@ -53,12 +54,12 @@ char * read_setupVarsconf(const char * key)
return NULL;
}

char * keystr = calloc(strlen(key)+2,sizeof(char));
linebuffer = calloc(1024,sizeof(char));
char * keystr = calloc(strlen(key)+2, sizeof(char));
linebuffer = calloc(SETUPVARSLINELENGTH, sizeof(char));

sprintf(keystr, "%s=", key);

while(fgets(linebuffer, 1023, setupVarsfp) != NULL)
while(fgets(linebuffer, SETUPVARSLINELENGTH, setupVarsfp) != NULL)
{
// Strip newline from fgets output
linebuffer[strlen(linebuffer) - 1] = '\0';
Expand Down

0 comments on commit 055ce53

Please sign in to comment.