From: <mar...@us...> - 2003-04-12 18:14:57
|
Update of /cvsroot/gphoto/libgphoto2/camlibs/ptp2 In directory sc8-pr-cvs1:/tmp/cvs-serv19809 Modified Files: ptp.c library.c Log Message: * ptp.c, library.c: Check return codes of property gets during --config. Index: ptp.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/ptp2/ptp.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ptp.c 3 Apr 2003 15:59:52 -0000 1.11 +++ ptp.c 12 Apr 2003 18:14:54 -0000 1.12 @@ -720,8 +720,10 @@ ptp.Param1=propcode; ptp.Nparam=1; ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &dpd); - ptp_unpack_DPD(params, dpd, devicepropertydesc); - free(dpd); + if (ret == PTP_RC_OK) { + ptp_unpack_DPD(params, dpd, devicepropertydesc); + free(dpd); + } return ret; } Index: library.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/ptp2/library.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- library.c 12 Apr 2003 15:15:21 -0000 1.14 +++ library.c 12 Apr 2003 18:14:54 -0000 1.15 @@ -589,7 +589,7 @@ GP_DEBUG ("Form Flag = 0x%.2x",dpd.FormFlag); if (dpd.DataType!=PTP_DTC_UINT8) { ptp_free_devicepropdesc(&dpd); - return GP_OK; + return GP_ERROR_NOT_SUPPORTED; } GP_DEBUG ("Factory Default Value = %0.2x",*(uint8_t *)dpd.FactoryDefaultValue); GP_DEBUG ("Current Value = %0.2x",*(uint8_t *)dpd.CurrentValue); |