Do some cleanup for the array copy implmentation.

Add binary string accessors for dictionaries.

Add pdfioDictCopy implementation.
This commit is contained in:
Michael R Sweet
2021-04-30 08:21:21 -04:00
parent 9610892dd7
commit 8031e31abb
2 changed files with 148 additions and 13 deletions

View File

@@ -252,8 +252,8 @@ pdfioArrayCopy(pdfio_file_t *pdf, // I - PDF file
if (!_pdfioValueCopy(pdf, &vdst, a->pdf, vsrc))
return (NULL); // Let pdfioFileClose do the cleanup...
if (!append_value(na, &vdst))
return (NULL); // Let pdfioFileClose do the cleanup...
// Cannot fail since we already allocated memory...
append_value(na, &vdst);
}
// Successfully copied the array, so return it...
@@ -520,9 +520,6 @@ static bool // O - `true` on success, `false` otherwise
append_value(pdfio_array_t *a, // I - Array
_pdfio_value_t *v) // I - Value
{
if (!a)
return (false);
if (a->num_values >= a->alloc_values)
{
_pdfio_value_t *temp = (_pdfio_value_t *)realloc(a->values, (a->alloc_values + 16) * sizeof(_pdfio_value_t));