Add error message for faulty config
This commit is contained in:
parent
f5bfafe269
commit
a12c72a26a
1 changed files with 3 additions and 3 deletions
6
rdo.c
6
rdo.c
|
|
@ -7,7 +7,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <bsd/readpassphrase.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;
|
char* line = NULL;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
|
||||||
|
|
@ -20,12 +20,12 @@ int getconf(FILE* fp, const char* entry, char* result, size_t len_result) {
|
||||||
if (token) {
|
if (token) {
|
||||||
strncpy(result, token, len_result);
|
strncpy(result, token, len_result);
|
||||||
result[strcspn(result, "\n")] = 0;
|
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) {
|
void runprog(int argc, char** argv) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue