diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -91,11 +91,13 @@ int getconfstr(char *confname, char *filename, char* dest) { // Returns the value 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) { + errno = 0; char result[MAXCHAR]; if (!getconfstr(confname, filename, result)) { - printf("getconfint(): error getting configuration option '%s' from configuration file '%s'.\n", confname, filename); debugprint(DEBUG_CRIT, "getconfint(): error getting configuration option '%s' from configuration file '%s'.\n", confname, filename); + errno = ECONFINT; } return strtol(result, NULL, 10); // Convert resulting string to an integer, base 10 |