]> git.feebdaed.xyz Git - 0xmirror/cJSON.git/commitdiff
Add a comment to the parameter count of the cJSON_CreateIntArray function.
authorAlanscut <wp_scut@163.com>
Tue, 25 Jun 2019 09:25:23 +0000 (17:25 +0800)
committerAlanscut <wp_scut@163.com>
Tue, 25 Jun 2019 09:25:23 +0000 (17:25 +0800)
cJSON.h

diff --git a/cJSON.h b/cJSON.h
index 592986b86e9fc0cb03af06f753c39b8c831b91a2..a2ae97f4cfa103a3000c7ea1f82dd1cd7342d65e 100644 (file)
--- 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);