Fixed minor warning and improved an error message

This commit is contained in:
Ariela Wenner 2019-03-29 12:45:22 -03:00
parent 16d1fd9788
commit 44ea513b9f
3 changed files with 6 additions and 5 deletions

View File

@ -51,10 +51,10 @@ build/release/objs/ConfigParse.o: src/ConfigParse.c src/ConfigParse.h
$(CC) $(FLAGS_RELEASE) -o $(OBJ_RELEASE_CFGP) -c src/ConfigParse.c
clean-all:
rm $(OBJS_DEBUG) $(OBJS_RELEASE) $(BINARY)
-rm -f $(OBJS_DEBUG) $(OBJS_RELEASE) $(BINARY)
clean-release:
rm $(OBJS_RELEASE) $(BINARY)
-rm -f $(OBJS_RELEASE) $(BINARY)
clean-debug:
rm $(OBJS_DEBUG) $(BINARY)
-rm -f $(OBJS_DEBUG) $(BINARY)

View File

@ -32,7 +32,7 @@ void cfgsection_load(FILE* fconfig, section_t* cfg, char* section_name) {
strcat(snamestr, section_name);
strcat(snamestr, "]");
uint32_t nbytes = 0;
size_t nbytes = 0;
char* gotline = NULL;
char* delim = "=\n";
char* delim2 = "\n";

View File

@ -45,7 +45,8 @@ int main(int argc, char* argv[]) {
FILE* fconfig = fopen("/etc/w3panik/w3panik.conf", "r");
if (fconfig == NULL) {
perror("Fatal error");
perror("Fatal error while trying to read configuration file");
fprintf(stderr, "Check for its presence at '/etc/w3panik/w3panik.conf' and try again.");
return EXIT_FAILURE;
}
section_t* options = config_init();