Fix pdfioStringCreate - was returning a char ** instead of a char *, causing

crashes/corruption.

Optimize dict allocation/sorting.

Add more values that are displayed by the testpdfio unit test program.
This commit is contained in:
Michael R Sweet
2021-05-05 13:51:42 -04:00
parent 4abb91ca24
commit c0b18a7e4f
3 changed files with 35 additions and 13 deletions

View File

@@ -65,6 +65,23 @@ main(int argc, // I - Number of command-line arguments
case PDFIO_VALTYPE_INDIRECT :
printf(" /%s %u %u R\n", pair->key, (unsigned)pair->value.value.indirect.number, pair->value.value.indirect.generation);
break;
case PDFIO_VALTYPE_NAME :
printf(" /%s /%s\n", pair->key, pair->value.value.name);
break;
case PDFIO_VALTYPE_STRING :
printf(" /%s (%s)\n", pair->key, pair->value.value.string);
break;
case PDFIO_VALTYPE_BINARY :
{
size_t bn;
unsigned char *bptr;
printf(" /%s <", pair->key);
for (bn = pair->value.value.binary.datalen, bptr = pair->value.value.binary.data; bn > 0; bn --, bptr ++)
printf("%02X", *bptr);
puts(">");
}
break;
case PDFIO_VALTYPE_NUMBER :
printf(" /%s %g\n", pair->key, pair->value.value.number);
break;