diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-16 08:58:55 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-16 08:58:55 +0100 |
commit | 54a229b3864fe7867da69ef7427877094a256f1c (patch) | |
tree | 44b314944e24f3ef522360d76255bbc21ea36e12 /test/enum.c | |
parent | 98511f7a77e7b37f9508b66298d99d7d1103e422 (diff) | |
download | uca-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 'test/enum.c')
-rw-r--r-- | test/enum.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/enum.c b/test/enum.c index 8803ec4..1164399 100644 --- a/test/enum.c +++ b/test/enum.c @@ -30,7 +30,8 @@ int main(int argc, char *argv[]) /* take first camera */ struct uca_camera_t *cam = uca->cameras; - char string_value[256]; + const size_t num_bytes = 256; + char string_value[num_bytes]; uint32_t uint32_value; uint8_t uint8_value; @@ -41,21 +42,21 @@ int main(int argc, char *argv[]) printf("%s = ", prop->name); switch (prop->type) { case uca_string: - if (cam->get_property(cam, i, string_value) != UCA_ERR_PROP_INVALID) { + if (cam->get_property(cam, i, string_value, num_bytes) != UCA_ERR_PROP_INVALID) { printf("%s ", string_value); } else printf("n/a"); break; case uca_uint32t: - if (cam->get_property(cam, i, &uint32_value) != UCA_ERR_PROP_INVALID) { + if (cam->get_property(cam, i, &uint32_value, 0) != UCA_ERR_PROP_INVALID) { printf("%i %s", uint32_value, uca_unit_map[prop->unit]); } else printf("n/a"); break; case uca_uint8t: - if (cam->get_property(cam, i, &uint8_value) != UCA_ERR_PROP_INVALID) { + if (cam->get_property(cam, i, &uint8_value, 0) != UCA_ERR_PROP_INVALID) { printf("%i %s", uint8_value, uca_unit_map[prop->unit]); } else |