diff options
Diffstat (limited to 'src/util/gnunet-qr.c')
-rw-r--r-- | src/util/gnunet-qr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c index 83b2af2fc..451d61d40 100644 --- a/src/util/gnunet-qr.c +++ b/src/util/gnunet-qr.c | |||
@@ -36,7 +36,7 @@ | |||
36 | /** | 36 | /** |
37 | * Video device to capture from. Sane default for GNU/Linux systems. | 37 | * Video device to capture from. Sane default for GNU/Linux systems. |
38 | */ | 38 | */ |
39 | static char *device = "/dev/video0"; | 39 | static char *device; |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * --verbose option | 42 | * --verbose option |
@@ -51,7 +51,7 @@ static int silent = false; | |||
51 | /** | 51 | /** |
52 | * Handler exit code | 52 | * Handler exit code |
53 | */ | 53 | */ |
54 | static long unsigned int exit_code = 1; | 54 | static long unsigned int exit_code = 0; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * Helper process we started. | 57 | * Helper process we started. |
@@ -228,6 +228,8 @@ get_symbol (zbar_processor_t *proc) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | /* initialize the Processor */ | 230 | /* initialize the Processor */ |
231 | if (NULL == device) | ||
232 | device = GNUNET_strdup ("/dev/video0"); | ||
231 | if (0 != (rc = zbar_processor_init (proc, device, 1))) | 233 | if (0 != (rc = zbar_processor_init (proc, device, 1))) |
232 | { | 234 | { |
233 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 235 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -306,6 +308,7 @@ run_zbar () | |||
306 | ret = GNUNET_strdup (data); | 308 | ret = GNUNET_strdup (data); |
307 | /* clean up */ | 309 | /* clean up */ |
308 | zbar_processor_destroy (proc); | 310 | zbar_processor_destroy (proc); |
311 | GNUNET_free (device); | ||
309 | return ret; | 312 | return ret; |
310 | } | 313 | } |
311 | 314 | ||