21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

if (!(spc_host_rulecount % 256)) {<br />

if (!(tmp = (spc_hostrule_t *)realloc(spc_host_rules,<br />

sizeof(spc_host_rulecount) * (spc_host_rulecount + 256))))<br />

return 0;<br />

spc_host_rules = tmp;<br />

}<br />

spc_host_rules[spc_host_rulecount++] = *rule;<br />

return 1;<br />

}<br />

static void free_rules(void) {<br />

int i;<br />

if (spc_host_rules) {<br />

for (i = 0; i < spc_host_rulecount; i++)<br />

if (spc_host_rules[i].name) free(spc_host_rules[i].name);<br />

free(spc_host_rules);<br />

spc_host_rulecount = 0;<br />

spc_host_rules = 0;<br />

}<br />

}<br />

static in_addr_t parse_addr(char *str) {<br />

int shift = 24;<br />

char *tmp;<br />

in_addr_t addr = 0;<br />

for (tmp = str; *tmp; tmp++) {<br />

if (*tmp = = '.') {<br />

*tmp = 0;<br />

addr |= (atoi(str)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!