1
0
Fork 0
forked from soccera/rdo

Add error message for faulty config

This commit is contained in:
sw1tchbl4d3 2021-07-13 23:31:23 +02:00
parent f5bfafe269
commit a12c72a26a

6
rdo.c
View file

@ -7,7 +7,7 @@
#include <string.h>
#include <bsd/readpassphrase.h>
int getconf(FILE* fp, const char* entry, char* result, size_t len_result) {
void getconf(FILE* fp, const char* entry, char* result, size_t len_result) {
char* line = NULL;
size_t len = 0;
@ -20,12 +20,12 @@ int getconf(FILE* fp, const char* entry, char* result, size_t len_result) {
if (token) {
strncpy(result, token, len_result);
result[strcspn(result, "\n")] = 0;
return 0;
return;
}
}
}
return 1;
errx(1, "Could not get '%s' entry in config", entry);
}
void runprog(int argc, char** argv) {