Skip to content

Commit

Permalink
Reduce scope of some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
DL6ER committed Feb 27, 2017
1 parent f3cab87 commit 77acf24
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ void readWildcardsList()
FILE *fp;
char *buffer, *domain;
char linebuffer[512];
int addrbuffer, i;
bool known;
int i;

if((fp = fopen(files.wildcards, "r")) == NULL) {
counters.wildcarddomains = -1;
Expand All @@ -87,9 +86,9 @@ void readWildcardsList()
// Search through file
while(fgets(linebuffer, 511, fp))
{
buffer = calloc(512,sizeof(char*));
addrbuffer = 0;
known = false;
buffer = calloc(512,sizeof(char));
int addrbuffer = 0;
bool known = false;
// Try to read up to 511 characters
if(sscanf(linebuffer, "address=/%511[^/]/%*[^\n]\n", buffer) > 0)
{
Expand Down Expand Up @@ -130,9 +129,7 @@ void readWildcardsList()
}

// Close the file
if(fp) {
fclose(fp);
}
fclose(fp);

}

Expand Down

0 comments on commit 77acf24

Please sign in to comment.