From a20b46933554a91aeece1bf73810a25dd0b579a9 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 24 Jun 2020 01:36:27 -0400 Subject: Replace atoi usage --- lib/config.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'lib/config.c') diff --git a/lib/config.c b/lib/config.c index 0fb17e8..8ead9a8 100644 --- a/lib/config.c +++ b/lib/config.c @@ -210,24 +210,3 @@ ConfigItem *config_get(ConfigItem **item, const char *key) { } return NULL; } - -void config_test(void) { - ConfigItem **config = config_read("program.conf"); - printf("Data Parsed:\n"); - for (int i = 0; config[i] != NULL; i++) { - printf("key: '%s', value: '%s'\n", config[i]->key, config[i]->value); - } - - printf("Testing config_get():\n"); - ConfigItem *cptr = NULL; - if ((cptr = config_get(config, "integer_value"))) { - printf("%s = %d\n", cptr->key, atoi(cptr->value)); - } - if ((cptr = config_get(config, "float_value"))) { - printf("%s = %.3f\n", cptr->key, atof(cptr->value)); - } - if ((cptr = config_get(config, "string_value"))) { - printf("%s = %s\n", cptr->key, cptr->value); - } - config_free(config); -} -- cgit