MCPcopy Create free account
hub / github.com/creatale/node-dv / sarrayExtendArray

Function sarrayExtendArray

deps/leptonica/src/sarray1.c:481–496  ·  view source on GitHub ↗

! * \brief sarrayExtendArray() * * \param[in] sa string array * \return 0 if OK, 1 on error */

Source from the content-addressed store, hash-verified

479 * \return 0 if OK, 1 on error
480 */
481static l_int32
482sarrayExtendArray(SARRAY *sa)
483{
484 PROCNAME("sarrayExtendArray");
485
486 if (!sa)
487 return ERROR_INT("sa not defined", procName, 1);
488
489 if ((sa->array = (char **)reallocNew((void **)&sa->array,
490 sizeof(char *) * sa->nalloc,
491 2 * sizeof(char *) * sa->nalloc)) == NULL)
492 return ERROR_INT("new ptr array not returned", procName, 1);
493
494 sa->nalloc *= 2;
495 return 0;
496}
497
498
499/*!

Callers 1

sarrayAddStringFunction · 0.85

Calls 1

reallocNewFunction · 0.85

Tested by

no test coverage detected