diff options
Diffstat (limited to 'product.c')
-rw-r--r-- | product.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -1,21 +1,25 @@ #include <stdlib.h> -#include "icclient/request.h" +#include "request.h" #include "icclient/product.h" void icclient_product_all(struct ic_catalog **catalogptr , size_t (*callback)(void *, size_t, size_t, void *)) { - request("All-Products", callback, (void *)catalogptr, NULL); + request(NULL, NULL, NULL, "%s", "All-Products"); } void rtclient_product_freecatalog(struct ic_catalog *catalog) { - for (unsigned short i = 0; i < catalog->length; i++) { + for (size_t i = 0; i < catalog->length; i++) { struct ic_product *product = catalog->products[i]; - free(product->image); - free(product->comment); - free(product->description); - free(product->sku); + if (product->image) + free(product->image); + if (product->comment) + free(product->comment); + if (product->description) + free(product->description); + if (product->sku) + free(product->sku); free(product); } free(catalog); |