diff --git a/samples/client/petstore/c/api/PetAPI.h b/samples/client/petstore/c/api/PetAPI.h index f223b60a0b8d..c24b44305cf5 100644 --- a/samples/client/petstore/c/api/PetAPI.h +++ b/samples/client/petstore/c/api/PetAPI.h @@ -8,6 +8,10 @@ #include "../model/api_response.h" #include "../model/pet.h" +#undef stdin +#undef stderr +#undef stdout + // Enum STATUS for PetAPI_findPetsByStatus typedef enum { openapi_petstore_findPetsByStatus_STATUS_NULL = 0, openapi_petstore_findPetsByStatus_STATUS_available, openapi_petstore_findPetsByStatus_STATUS_pending, openapi_petstore_findPetsByStatus_STATUS_sold } openapi_petstore_findPetsByStatus_status_e; diff --git a/samples/client/petstore/c/api/StoreAPI.h b/samples/client/petstore/c/api/StoreAPI.h index 43bdf7583767..21985044c200 100644 --- a/samples/client/petstore/c/api/StoreAPI.h +++ b/samples/client/petstore/c/api/StoreAPI.h @@ -7,6 +7,10 @@ #include "../include/binary.h" #include "../model/order.h" +#undef stdin +#undef stderr +#undef stdout + // Delete purchase order by ID // diff --git a/samples/client/petstore/c/api/UserAPI.h b/samples/client/petstore/c/api/UserAPI.h index b0a60accdab9..d6e43056f13b 100644 --- a/samples/client/petstore/c/api/UserAPI.h +++ b/samples/client/petstore/c/api/UserAPI.h @@ -7,6 +7,10 @@ #include "../include/binary.h" #include "../model/user.h" +#undef stdin +#undef stderr +#undef stdout + // Create user // diff --git a/samples/client/petstore/c/model/api_response.h b/samples/client/petstore/c/model/api_response.h index d64dcbacedd9..fe0c87f9a5f9 100644 --- a/samples/client/petstore/c/model/api_response.h +++ b/samples/client/petstore/c/model/api_response.h @@ -16,6 +16,10 @@ typedef struct api_response_t api_response_t; +#undef stdin +#undef stderr +#undef stdout + typedef struct api_response_t { diff --git a/samples/client/petstore/c/model/category.h b/samples/client/petstore/c/model/category.h index ec9efd6ccf60..9ef031f5c692 100644 --- a/samples/client/petstore/c/model/category.h +++ b/samples/client/petstore/c/model/category.h @@ -16,6 +16,10 @@ typedef struct category_t category_t; +#undef stdin +#undef stderr +#undef stdout + typedef struct category_t { diff --git a/samples/client/petstore/c/model/order.h b/samples/client/petstore/c/model/order.h index 32914a227499..099ce89d8b8a 100644 --- a/samples/client/petstore/c/model/order.h +++ b/samples/client/petstore/c/model/order.h @@ -16,6 +16,10 @@ typedef struct order_t order_t; +#undef stdin +#undef stderr +#undef stdout + // Enum STATUS for order typedef enum { openapi_petstore_order_STATUS_NULL = 0, openapi_petstore_order_STATUS_placed, openapi_petstore_order_STATUS_approved, openapi_petstore_order_STATUS_delivered } openapi_petstore_order_STATUS_e; diff --git a/samples/client/petstore/c/model/pet.h b/samples/client/petstore/c/model/pet.h index d74025510143..561d1ac508b2 100644 --- a/samples/client/petstore/c/model/pet.h +++ b/samples/client/petstore/c/model/pet.h @@ -18,6 +18,10 @@ typedef struct pet_t pet_t; #include "category.h" #include "tag.h" +#undef stdin +#undef stderr +#undef stdout + // Enum STATUS for pet typedef enum { openapi_petstore_pet_STATUS_NULL = 0, openapi_petstore_pet_STATUS_available, openapi_petstore_pet_STATUS_pending, openapi_petstore_pet_STATUS_sold } openapi_petstore_pet_STATUS_e; diff --git a/samples/client/petstore/c/model/tag.h b/samples/client/petstore/c/model/tag.h index 9e7b5d053a9d..0917db85e5c2 100644 --- a/samples/client/petstore/c/model/tag.h +++ b/samples/client/petstore/c/model/tag.h @@ -16,6 +16,10 @@ typedef struct tag_t tag_t; +#undef stdin +#undef stderr +#undef stdout + typedef struct tag_t { diff --git a/samples/client/petstore/c/model/user.h b/samples/client/petstore/c/model/user.h index 45fa42c3f91c..15f25b12c620 100644 --- a/samples/client/petstore/c/model/user.h +++ b/samples/client/petstore/c/model/user.h @@ -16,6 +16,10 @@ typedef struct user_t user_t; +#undef stdin +#undef stderr +#undef stdout + typedef struct user_t { diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index 2ab296b2e637..ce2f522cda28 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -476,7 +476,7 @@ size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) { size_t size_this_time = nmemb * size; apiClient_t *apiClient = (apiClient_t *)userp; apiClient->dataReceived = (char *)realloc( apiClient->dataReceived, apiClient->dataReceivedLen + size_this_time + 1); - memcpy(apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); + memcpy((char *)apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time); apiClient->dataReceivedLen += size_this_time; ((char*)apiClient->dataReceived)[apiClient->dataReceivedLen] = '\0'; // the space size of (apiClient->dataReceived) = dataReceivedLen + 1 if (apiClient->data_callback_func) {