All pastes #959429 Raw Edit

alesan

public c v1 · immutable
#959429 ·published 2008-03-27 13:17 UTC
rendered paste body
# cat /etc/config/programminoconfig camera           A        option zoom     14config camera           B        option zoom     2#include <stdio.h>#include <uci/uci.h>int main(){        struct uci_context *ctx;        struct uci_package *p = NULL;        struct uci_element *e = NULL;        char *package = NULL;        char* section = NULL;        char* option = NULL;        char* value = NULL;        char** ptr = NULL;        char* comando = "programmino.B.zoom";        ctx = uci_alloc_context();        if (!ctx)        {                printf("Out of memory\n");                return 1;        }        if(uci_parse_tuple(ctx, comando, &package, &section, &option, ptr) != UCI_OK)                return 1;        //printf("%s - %s - %s", package, section, option);        uci_free_context(ctx);        return 0;}# colorgcc -Wall -g -o opzione -luci opzione.copzione.c: In function 'main':opzione.c:12: warning: unused variable 'value'opzione.c:8: warning: unused variable 'e'opzione.c:7: warning: unused variable 'p'# ./opzioneSegmentation fault (core dumped)