From 85ceadb4b42bd8c80893595bf25a4a8acb24dae4 Mon Sep 17 00:00:00 2001 From: Alanscut Date: Tue, 25 Jun 2019 17:25:23 +0800 Subject: [PATCH] Add a comment to the parameter count of the cJSON_CreateIntArray function. --- cJSON.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cJSON.h b/cJSON.h index 592986b..a2ae97f 100644 --- a/cJSON.h +++ b/cJSON.h @@ -208,7 +208,8 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); -/* These utilities create an Array of count items. */ +/* These utilities create an Array of count items. * +*The parameter count cannot be greater than the number of elements in the number array,otherwise array access will be out of bounds.*/ CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count); CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count);