mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
33 lines
748 B
C
33 lines
748 B
C
/* Pi-hole: A black hole for Internet advertisements
|
|
* (c) 2017 Pi-hole, LLC (https://pi-hole.net)
|
|
* Network-wide ad blocking via your own hardware.
|
|
*
|
|
* FTL Engine
|
|
* Config routines
|
|
*
|
|
* This file is copyright under the latest version of the EUPL.
|
|
* Please see LICENSE file for your rights under this license. */
|
|
|
|
#include "FTL.h"
|
|
|
|
void get_privacy_level(FILE *fp)
|
|
{
|
|
// See if we got a file handle
|
|
bool opened = false;
|
|
if(fp == NULL)
|
|
{
|
|
if((fp = fopen(FTLfiles.conf, "r")) == NULL)
|
|
return;
|
|
opened = true;
|
|
}
|
|
|
|
int value = config.privacylevel;
|
|
char *buffer = parse_FTLconf(fp, "PRIVACYLEVEL");
|
|
if(buffer != NULL && sscanf(buffer, "%i", &value))
|
|
if(value > 0 && value <= 65535)
|
|
config.port = value;
|
|
|
|
if(opened)
|
|
fclose(fp);
|
|
}
|