Lines Matching defs:str_buf_size
177 size_t str_buf_size;
180 str_buf_size = 2; /* special case for 0. */
182 str = ensure(item->pAllocator, p, str_buf_size);
184 str = (char *)cJSON_malloc(item->pAllocator, str_buf_size);
185 if (str) loader_strncpy(str, str_buf_size, "0", 2);
187 str_buf_size = 21; /* 2^64+1 can be represented in 21 chars. */
189 str = ensure(item->pAllocator, p, str_buf_size);
191 str = (char *)cJSON_malloc(item->pAllocator, str_buf_size);
192 if (str) snprintf(str, str_buf_size, "%d", item->valueint);
194 str_buf_size = 64; /* This is a nice tradeoff. */
196 str = ensure(item->pAllocator, p, str_buf_size);
198 str = (char *)cJSON_malloc(item->pAllocator, str_buf_size);
201 snprintf(str, str_buf_size, "%.0f", d);
203 snprintf(str, str_buf_size, "%e", d);
205 snprintf(str, str_buf_size, "%f", d);