summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/grab.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/grab.c b/test/grab.c
index b7c24dd..54e6955 100644
--- a/test/grab.c
+++ b/test/grab.c
@@ -75,6 +75,9 @@ int main(int argc, char *argv[])
while ((error == UCA_NO_ERROR) && (counter < 20)) {
error = uca_cam_grab(cam, (char *) buffer, NULL);
+ if (error != UCA_NO_ERROR)
+ break;
+
snprintf(filename, FILENAME_MAX, "frame-%08i.raw", counter++);
FILE *fp = fopen(filename, "wb");
fwrite(buffer, width*height, pixel_size, fp);