Browse Source

* parse_config() : add assert()s

master
Alex 'AdUser' Z 9 years ago
parent
commit
ae60c15ebb
  1. 4
      src/config.c

4
src/config.c

@ -1,3 +1,4 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
@ -15,6 +16,9 @@ int parse_config(oal_config_t * const config, const char *file) {
char *key, *value;
size_t valsize;
assert(config != NULL);
assert(file != NULL);
if ((f = fopen(file, "r")) == NULL) {
snprintf(err, bufsize, "can't open file: %s", strerror(errno));
config->error = strndup(err, bufsize);

Loading…
Cancel
Save