Procházet zdrojové kódy

getline handling bug

tags/v1.1.0
Pascal Gloor před 5 roky
rodič
revize
c66a53ecea
2 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 2
    1
      src/Makefile
  2. 5
    1
      src/dp_helpers.c

+ 2
- 1
src/Makefile Zobrazit soubor

@@ -15,7 +15,8 @@
###############################################################################

CC := gcc
CCFLAGS := -Wall -Werror -pedantic -O2 -I../inc
CCFLAGS := -Wall -Werror -pedantic -O2
#CCFLAGS := -Wall -Werror -pedantic -g
LDFLAGS := -lnetfilter_queue -lpthread

TARGETS:= dhcp_protect

+ 5
- 1
src/dp_helpers.c Zobrazit soubor

@@ -64,7 +64,8 @@ dp_conf *dp_load_config(dp_conf *conf, char *file) {
int error = 0;

printf("Loading configuration %s\n",file);

memset(conf, 0, sizeof(dp_conf));

if ( ( fh = fopen(file,"r") ) == NULL ) {
fprintf(stderr,"Failed to open configuration file '%s': %s\n", file, strerror(errno));
@@ -100,7 +101,10 @@ dp_conf *dp_load_config(dp_conf *conf, char *file) {
fprintf(stderr,"unknown directive '%s', ignored\n", name);

free(line);
len=0;
line=NULL;
}

fclose(fh);

if ( conf->pktint < 1 || conf->pktint > 1000 ) {

Načítá se…
Zrušit
Uložit