Explorar el Código

getline handling bug

tags/v1.1.0
Pascal Gloor hace 5 años
padre
commit
c66a53ecea
Se han modificado 2 ficheros con 7 adiciones y 2 borrados
  1. 2
    1
      src/Makefile
  2. 5
    1
      src/dp_helpers.c

+ 2
- 1
src/Makefile Ver fichero

@@ -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 Ver fichero

@@ -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 ) {

Cargando…
Cancelar
Guardar