summaryrefslogtreecommitdiffstats
path: root/src/cameras/pf.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-16 08:58:55 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-16 08:58:55 +0100
commit54a229b3864fe7867da69ef7427877094a256f1c (patch)
tree44b314944e24f3ef522360d76255bbc21ea36e12 /src/cameras/pf.c
parent98511f7a77e7b37f9508b66298d99d7d1103e422 (diff)
downloaduca-54a229b3864fe7867da69ef7427877094a256f1c.tar.gz
uca-54a229b3864fe7867da69ef7427877094a256f1c.tar.bz2
uca-54a229b3864fe7867da69ef7427877094a256f1c.tar.xz
uca-54a229b3864fe7867da69ef7427877094a256f1c.zip
Pass target string size when calling uca_get_property
Diffstat (limited to 'src/cameras/pf.c')
-rw-r--r--src/cameras/pf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cameras/pf.c b/src/cameras/pf.c
index 5b0679e..c1267e3 100644
--- a/src/cameras/pf.c
+++ b/src/cameras/pf.c
@@ -107,7 +107,7 @@ static uint32_t uca_pf_set_property(struct uca_camera_t *cam, enum uca_property_
}
-static uint32_t uca_pf_get_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data)
+static uint32_t uca_pf_get_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data, size_t num)
{
TOKEN t; /* You gotta love developers who name types capitalized... */
PFValue value;
@@ -133,7 +133,7 @@ static uint32_t uca_pf_get_property(struct uca_camera_t *cam, enum uca_property_
set_void(data, uint32_t, (uint32_t) floor(atof(value.value.p)+0.5));
}
else {
- strcpy((char *) data, value.value.p);
+ strncpy((char *) data, value.value.p, num);
}
break;
@@ -219,8 +219,8 @@ uint32_t uca_pf_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
val = UCA_TRIGGER_FREERUN;
grabber->set_property(grabber, UCA_GRABBER_TRIGGER_MODE, &val);
- uca_pf_get_property(uca, UCA_PROP_WIDTH, &uca->frame_width);
- uca_pf_get_property(uca, UCA_PROP_HEIGHT, &uca->frame_height);
+ uca_pf_get_property(uca, UCA_PROP_WIDTH, &uca->frame_width, 0);
+ uca_pf_get_property(uca, UCA_PROP_HEIGHT, &uca->frame_height, 0);
grabber->set_property(grabber, UCA_GRABBER_WIDTH, &uca->frame_width);
grabber->set_property(grabber, UCA_GRABBER_HEIGHT, &uca->frame_height);