summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-06-01 19:22:13 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-06-01 19:22:13 +0100
commitd38794635a763174d62790cf350ee5665737c6ef (patch)
tree77068c5eca225e658baea54ff2a833b05f7c9ece /config.h
parentc3f421e4046faf8b5f39cd1ad36bc4869405fcc9 (diff)
Use errno to handle getconfint() failing.
Diffstat (limited to 'config.h')
-rw-r--r--config.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/config.h b/config.h
index c997750..ce80177 100644
--- a/config.h
+++ b/config.h
@@ -13,6 +13,7 @@
#define DEBUG_CRIT 0
#define DEBUG_SOME 1
#define DEBUG_FULL 2
+#define ECONFINT 1 // errno value if getconfint() failed
#define MAXCHAR 1000
@@ -24,6 +25,7 @@ int getconfstr(char *confname, char *filename, char* dest);
// Returns the avlue of the configuration option with name
// 'confname' from configuration file 'filename'.
+// Sets errno to 0 on success, or ECONFINT if it fails, in which case the return value is undefined.
int getconfint(char *confname, char *filename);
// Check the password provided in the string 'str' against what is in