davisouzaluna / Dpubsub

Dynamic publisher/subscriber implementation in C
MIT License
0 stars 0 forks source link

[BUG]getters and setters #5

Open davisouzaluna opened 3 weeks ago

davisouzaluna commented 3 weeks ago

If I try to create a new client and set a value, it cannot access the memory space. But if it already exists, it can do it. Think about logic

Create New client

create_client(&client, &config, buffer_size);

- Don't work:
```c
    client_t client;
    client_config_t config;
    size_t buffer_size = 0;
    char *client_id = "test_client_struct";

    set_client_id(&client, "test_client_struct");
    printf("debug\n");
    set_keep_alive(&client, 60);
    set_broker_ip(&client, global_ip_broker);
    set_broker_port(&client, global_port_broker);
    set_config(&client, &config);

create_client(&client, &config, buffer_size);

Return error:

Segmentation fault
davisouzaluna commented 1 week ago

commit 138217ac5dbb50d46b1cb021a6a53d122692312e