/* Load a name from the auxiliary data. Since this extracts undocumented strings from the font file, we need to be careful here.  */
static FT_Error pfr_aux_name_load(FT_Byte *p, FT_UInt len, FT_Memory memory, FT_String **astring)
/* Load a name from the auxiliary data. Since this extracts undocumented strings from the font file, we need to be careful here.  */
static FT_Error pfr_aux_name_load(FT_Byte *p, FT_UInt len, FT_Memory memory, FT_String **astring)
{
    FT_Error    error  = FT_Err_Ok;
    FT_String*  result = NULL;
    FT_UInt     n, ok;
    if ( *astring )
      FT_FREE( *astring );
    if ( len > 0 && p[len - 1] == 0 )
      len--;
    ok = ( len > 0 );
    for ( n = 0; n < len; n++ )
      if ( p[n] < 32 || p[n] > 127 )
      {
        ok = 0;
        break;
      }
    if ( ok )
    {
      if ( FT_QALLOC( result, len + 1 ) )
        goto Exit;
      FT_MEM_COPY( result, p, len );
      result[len] = 0;
    }
  Exit:
    *astring = result;
    return error;
  }