From: <mar...@us...> - 2007-06-25 20:54:59
|
Revision: 10407 http://svn.sourceforge.net/gphoto/?rev=10407&view=rev Author: marcusmeissner Date: 2007-06-25 13:54:55 -0700 (Mon, 25 Jun 2007) Log Message: ----------- 0 entry enums are not enums.? Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ptp-pack.c Modified: trunk/libgphoto2/camlibs/ptp2/ptp-pack.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2007-06-25 20:47:25 UTC (rev 10406) +++ trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2007-06-25 20:54:55 UTC (rev 10407) @@ -1117,24 +1117,26 @@ fprintf (stderr, "propxtype is %x for %x, unhandled.\n", propxtype, proptype); break; } - dpd->FormFlag = PTP_DPFF_Enumeration; - dpd->FORM.Enum.NumberOfValues = propxcnt; - dpd->FORM.Enum.SupportedValue = malloc (sizeof (PTPPropertyValue)*propxcnt); - for (j=0;j<propxcnt;j++) { - switch (dpd->DataType) { - case PTP_DTC_UINT16: - dpd->FORM.Enum.SupportedValue[j].u16 = dtoh16a(data); - fprintf (stderr,"suppvalue[%d] of %x is %x\n", j, proptype, dtoh16a(data)); - break; - case PTP_DTC_UINT8: - dpd->FORM.Enum.SupportedValue[j].u8 = dtoh8a(data); - fprintf (stderr,"suppvalue[%d] of %x is %x\n", j, proptype, dtoh8a(data)); - break; - default: - fprintf(stderr,"data type 0x%04x of %x unhandled, fill in.\n", dpd->DataType, proptype); - break; + if (propxcnt) { + dpd->FormFlag = PTP_DPFF_Enumeration; + dpd->FORM.Enum.NumberOfValues = propxcnt; + dpd->FORM.Enum.SupportedValue = malloc (sizeof (PTPPropertyValue)*propxcnt); + for (j=0;j<propxcnt;j++) { + switch (dpd->DataType) { + case PTP_DTC_UINT16: + dpd->FORM.Enum.SupportedValue[j].u16 = dtoh16a(data); + fprintf (stderr,"suppvalue[%d] of %x is %x\n", j, proptype, dtoh16a(data)); + break; + case PTP_DTC_UINT8: + dpd->FORM.Enum.SupportedValue[j].u8 = dtoh8a(data); + fprintf (stderr,"suppvalue[%d] of %x is %x\n", j, proptype, dtoh8a(data)); + break; + default: + fprintf(stderr,"data type 0x%04x of %x unhandled, fill in.\n", dpd->DataType, proptype); + break; + } + data += 4; /* might only be for propxtype 3 */ } - data += 4; /* might only be for propxtype 3 */ } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |