Parcourir la source

Add a comment to the parameter count of the cJSON_CreateIntArray function.

Alanscut il y a 6 ans
Parent
commit
85ceadb4b4
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      cJSON.h

+ 2 - 1
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);