vcpkg/ports/mchehab-zbar/x64.patch
Ulysses1337 55112eb54a
[mchehab-zbar] Add new port (#16113)
* Add mchehab/zbar

* Quote all paths

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>

* Update to 0.23.90

* Flip name

* Update version registry

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
2022-08-24 09:08:34 -07:00

22 lines
640 B
Diff

diff --git a/zbar/decoder.c b/zbar/decoder.c
index 7f7336f..e9ffc45 100644
--- a/zbar/decoder.c
+++ b/zbar/decoder.c
@@ -25,6 +25,7 @@
#include <stdlib.h> /* malloc, calloc, free */
#include <stdio.h> /* snprintf */
#include <string.h> /* memset, strlen */
+#include <stddef.h> /* offsetof */
#include <zbar.h>
@@ -113,7 +114,7 @@ void zbar_decoder_destroy (zbar_decoder_t *dcode)
void zbar_decoder_reset (zbar_decoder_t *dcode)
{
- memset(dcode, 0, (long)&dcode->buf_alloc - (long)dcode);
+ memset(dcode, 0, offsetof(zbar_decoder_t, buf_alloc));
#if ENABLE_EAN == 1
ean_reset(&dcode->ean);
#endif