MCPcopy Create free account
hub / github.com/apache/httpd / md_json_limita

Function md_json_limita

modules/md/md_json.c:577–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577apr_size_t md_json_limita(size_t max_elements, md_json_t *json, ...)
578{
579 json_t *j;
580 va_list ap;
581 apr_size_t n = 0;
582
583 va_start(ap, json);
584 j = jselect(json, ap);
585 va_end(ap);
586
587 if (j && json_is_array(j)) {
588 n = json_array_size(j);
589 while (n > max_elements) {
590 json_array_remove(j, n-1);
591 n = json_array_size(j);
592 }
593 }
594 return n;
595}
596
597/**************************************************************************************************/
598/* arrays / objects */

Callers 1

md_job_log_appendFunction · 0.85

Calls 1

jselectFunction · 0.85

Tested by

no test coverage detected