[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: gnunet-qr/uri: Fix exit code handling; f
From: |
gnunet |
Subject: |
[gnunet] branch master updated: gnunet-qr/uri: Fix exit code handling; fix memory corruption |
Date: |
Wed, 02 Sep 2020 19:33:10 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 3ec73fc68 gnunet-qr/uri: Fix exit code handling; fix memory corruption
3ec73fc68 is described below
commit 3ec73fc6825c6a0bd2a51364f8f8849245c89e25
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Wed Sep 2 19:26:37 2020 +0200
gnunet-qr/uri: Fix exit code handling; fix memory corruption
---
src/util/gnunet-qr.c | 7 +++++--
src/util/gnunet-uri.c | 2 +-
2 files changed, 6 insertions(+), 3 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 @@
/**
* Video device to capture from. Sane default for GNU/Linux systems.
*/
-static char *device = "/dev/video0";
+static char *device;
/**
* --verbose option
@@ -51,7 +51,7 @@ static int silent = false;
/**
* Handler exit code
*/
-static long unsigned int exit_code = 1;
+static long unsigned int exit_code = 0;
/**
* Helper process we started.
@@ -228,6 +228,8 @@ get_symbol (zbar_processor_t *proc)
}
/* initialize the Processor */
+ if (NULL == device)
+ device = GNUNET_strdup ("/dev/video0");
if (0 != (rc = zbar_processor_init (proc, device, 1)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -306,6 +308,7 @@ run_zbar ()
ret = GNUNET_strdup (data);
/* clean up */
zbar_processor_destroy (proc);
+ GNUNET_free (device);
return ret;
}
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index 9443c9120..de0ff1f92 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -29,7 +29,7 @@
/**
* Handler exit code
*/
-static long unsigned int exit_code = 1;
+static long unsigned int exit_code = 0;
/**
* Helper process we started.
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: gnunet-qr/uri: Fix exit code handling; fix memory corruption,
gnunet <=