Typo fix
This commit is contained in:
parent
f5f0e1f756
commit
16d1fd9788
|
@ -51,7 +51,7 @@ Now you can run it and it'll launch as a daemon. It will respond to `SIGTERM` an
|
|||
* Recent GCC version in a Linux system.
|
||||
* Your tipycal build essentials.
|
||||
* Somewhat recent version of glibc -- we use some non-standard features.
|
||||
* Linux susbsystem input headers -- you probably have these already.
|
||||
* Linux input subsystem headers -- you probably have these already.
|
||||
|
||||
From there, do either `make debug` or `make release` and you can run it `sudo ./w3panik` (preferably after configuring it).
|
||||
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
/*
|
||||
/*
|
||||
* This file is part of w3panik
|
||||
*
|
||||
*
|
||||
* w3panik - (C) 2018 Ariela Wenner - <arisunz@disroot.org>
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ConfigParse.h"
|
||||
|
@ -31,7 +31,7 @@ void cfgsection_load(FILE* fconfig, section_t* cfg, char* section_name) {
|
|||
char snamestr[11] = "[";
|
||||
strcat(snamestr, section_name);
|
||||
strcat(snamestr, "]");
|
||||
|
||||
|
||||
uint32_t nbytes = 0;
|
||||
char* gotline = NULL;
|
||||
char* delim = "=\n";
|
||||
|
@ -40,6 +40,7 @@ void cfgsection_load(FILE* fconfig, section_t* cfg, char* section_name) {
|
|||
if (strstr(gotline, snamestr)) {
|
||||
// keep reading until we reach OEF or a new section
|
||||
while (getline(&gotline, &nbytes, fconfig) != -1 && !(strstr(gotline, "]"))) {
|
||||
// I'm not exactly proud of this, but it'll do for now
|
||||
if (strstr(gotline, "=") && !(strstr(gotline, "#"))) {
|
||||
char* cpy = strdup(gotline);
|
||||
char* key = strtok(cpy, delim);
|
||||
|
@ -60,7 +61,7 @@ void config_append(section_t* cfg, char* key, char* value) {
|
|||
|
||||
cfg->option_list_start->key = strdup(key);
|
||||
cfg->option_list_start->value = strdup(value);
|
||||
|
||||
|
||||
cfg->option_list_start->next = NULL;
|
||||
cfg->section_size = 1;
|
||||
return;
|
||||
|
@ -90,12 +91,12 @@ char* config_get(section_t* cfg, char* key) {
|
|||
return current->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL; // we found nothing
|
||||
}
|
||||
|
||||
void config_dealloc(section_t* cfg) {
|
||||
/*
|
||||
/*
|
||||
* Free all resources in config
|
||||
* and set its pointer to NULL
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue