summaryrefslogtreecommitdiff
path: root/src/ptp-pack.c
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2008-08-16 23:52:06 +0000
committerLinus Walleij <triad@df.lth.se>2008-08-16 23:52:06 +0000
commitdeddc3490b3084b802737017982285bfa58b382f (patch)
tree3035c30d3ae3ca03e35cb3a6ed4b7bedc00d15cf /src/ptp-pack.c
parent605979b62118c0adc5e86173bbf43f503dbfc17f (diff)
downloadlibmtp-deddc3490b3084b802737017982285bfa58b382f.tar.gz
Move stuff around, sync upstream.
Diffstat (limited to 'src/ptp-pack.c')
-rw-r--r--src/ptp-pack.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ptp-pack.c b/src/ptp-pack.c
index 5ce1303..fd2b58d 100644
--- a/src/ptp-pack.c
+++ b/src/ptp-pack.c
@@ -649,7 +649,7 @@ ptp_unpack_DPV (
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 @@ ptp_unpack_DPD (PTPParams *params, unsigned char* data, PTPDevicePropDesc *dpd,
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 @@ ptp_unpack_DPD (PTPParams *params, unsigned char* data, PTPDevicePropDesc *dpd,
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;