/
githubmirror
/
libeconf
Обзор
Документация
Войти
/
githubmirror
/
libeconf
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/tst-arguments2.c
37 строк
744 B
Stefan Schubert
Removed PATH_MAX (#226)
09 дек 2024, 18:49
Не верифицирован
09 дек 2024, 18:49
3f83557
Код
Авторство
О чём код?
#ifdef HAVE_CONFIG_H # include <config.h> #endif #include <stdio.h> #include <string.h> #include "libeconf.h" /* Test case: * Provide a NULL pointer for the group. Means there is no group. */ int main(void) { econf_file *key_file = NULL; char *val; econf_err error; if ((error = econf_readFile (&key_file, TESTSDIR"tst-arguments-data/etc/arguments.conf", "=", "#"))) { fprintf (stderr, "ERROR: couldn't read configuration file: %s\n", econf_errString(error)); return 1; } if ((error = econf_getStringValue (key_file, NULL, "KEY", &val)) || val == NULL || strlen(val) == 0) { fprintf (stderr, "KEY returns nothing!\n"); return 1; } free (val); econf_free (key_file); return 0; }