do not feed binary stuff into a text widget
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11197 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -1511,6 +1511,7 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
int res_byte1, res_byte2, res_byte3;
|
||||
int pwr_status, pwr_source, res, i, menuval;
|
||||
time_t camtime;
|
||||
char formatted_camera_time[30];
|
||||
|
||||
GP_DEBUG ("camera_get_config()");
|
||||
|
||||
@@ -1837,7 +1838,9 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context)
|
||||
if (camera->pl->cached_ready == 1) {
|
||||
res = canon_int_get_time (camera, &camtime, context);
|
||||
if (res == GP_OK) {
|
||||
gp_widget_set_value (t, &camtime);
|
||||
strftime (formatted_camera_time, sizeof (formatted_camera_time),
|
||||
"%Y-%m-%d %H:%M:%S", gmtime (&camtime));
|
||||
gp_widget_set_value (t, formatted_camera_time);
|
||||
} else {
|
||||
gp_widget_set_value (t, _("Error"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user