From: <mar...@us...> - 2008-08-01 11:52:50
|
Revision: 11261 http://gphoto.svn.sourceforge.net/gphoto/?rev=11261&view=rev Author: marcusmeissner Date: 2008-08-01 11:52:59 +0000 (Fri, 01 Aug 2008) Log Message: ----------- some bugfixes for empty strings, and properites which have just the factory default, but no currentvalue (as seen on the D700) Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ptp-pack.c Modified: trunk/libgphoto2/camlibs/ptp2/ptp-pack.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2008-08-01 11:43:51 UTC (rev 11260) +++ trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2008-08-01 11:52:59 UTC (rev 11261) @@ -649,7 +649,7 @@ value->str = ptp_unpack_string(params,data,*offset,&len); *offset += len*2+1; if (!value->str) - return 0; + return 1; break; } default: @@ -674,10 +674,13 @@ dpd->DevicePropertyCode=dtoh16a(&data[PTP_dpd_DevicePropertyCode]); dpd->DataType=dtoh16a(&data[PTP_dpd_DataType]); dpd->GetSet=dtoh8a(&data[PTP_dpd_GetSet]); + dpd->FormFlag=PTP_DPFF_None; offset = PTP_dpd_FactoryDefaultValue; ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->FactoryDefaultValue, dpd->DataType); if (!ret) goto outofmemory; + if ((dpd->DataType == PTP_DTC_STR) && (offset == dpdlen)) + return 1; ret = ptp_unpack_DPV (params, data, &offset, dpdlen, &dpd->CurrentValue, dpd->DataType); if (!ret) goto outofmemory; @@ -686,7 +689,6 @@ values). In both cases Form Flag should be set to 0x00 and FORM is not present. */ - dpd->FormFlag=PTP_DPFF_None; if (offset==PTP_dpd_FactoryDefaultValue) return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |