commit 32567cf08856b0351b4dfbb8245374cc5c0d0cf1
parent f120263f2f1a608e94fd5e59064780f311fe7752
Author: lash <dev@holbrook.no>
Date: Tue, 16 Apr 2024 02:00:42 +0100
Replace signed integer packager from liblash
Diffstat:
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
@@ -32,7 +32,7 @@ The code expects objects from these source trees to be available somehow:
|project | upstream source | version | tar.gz sha256 |
|---|---|---|---|
-| liblash | [https://holbrook.no/src/liblash](https://holbrook.no/src/liblash) `(4e704929297371934cb5ace5fb59433f6c664c34)` | `0.1.0` | `15d90c518626eac4333e3fa8a02e4bcf16cce31e99e6c6668cc2e4ca44691cd3` |
+| liblash | [https://holbrook.no/src/liblash](https://holbrook.no/src/liblash) `(193dd4032e8088ada2dc9dcedab8d7486e9305f5)` | `0.1.0` | `333cdf49bb7e9f44b37e5bc9f594a01e4b3b8ecb3fcd3d9ffec3ea6dcdeaec7b` |
| varint.c | [https://github.com/tidwall/varint.c](https://github.com/tidwall/varint.c) `(7e1f7067eaf6ee114d865c99a8f5f01c813f3a61)` | `0.1.0` | `e33f83a8cd965827554c134bcb607990c04c0097cd57e49ae8c343c6d311826f` |
| libcmime | [https://github.com/spmfilter/libcmime.git](https://github.com/spmfilter/libcmime.git) `(dd21eb096d162656e30243f60fc4bc35ad39ae6e)` | `0.2.2` | `18a8d46ebec575a79212acc2dc6af7fd7bdeba3a9b85a70677ed0b7785c5c04e` |
| gst-plugins-rs | [https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs](https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs) `(a84bbc66f30573b62871db163c48afef75adf6ec)` | `1.22.10 (gstreamer)` | `691d5d52f59ec6322a2f6ddc1039ef47c9ac5e6328e2df1ef920629b46c659df` |
diff --git a/src/gtk/kee-entry.c b/src/gtk/kee-entry.c
@@ -17,6 +17,8 @@
#include "db.h"
#include "digest.h"
#include "debug.h"
+#include "endian.h"
+#include "strip.h"
typedef struct {
@@ -113,7 +115,6 @@ static int kee_entry_deserialize_item(KeeEntry *o, const char *data, size_t data
int c;
int v;
char *p;
- int effs = -1;
memset(&root, 0, sizeof(root));
memset(&item, 0, sizeof(item));
@@ -145,12 +146,8 @@ static int kee_entry_deserialize_item(KeeEntry *o, const char *data, size_t data
fprintf(stderr, "%s\n", err);
return r;
}
- p = (char*)&alice;
- if (*((char*)&v)) {
- memcpy(p, &effs, 4);;
- }
- p += sizeof(alice) - c;
- memcpy(p, &v, c);
+
+ strap_be(p, c, (char*)&alice, sizeof(alice));
if (is_le()) {
flip_endian(sizeof(int), (void*)&alice);
}
@@ -164,13 +161,8 @@ static int kee_entry_deserialize_item(KeeEntry *o, const char *data, size_t data
fprintf(stderr, "%s\n", err);
return r;
}
- p = (char*)&bob;
- if (*((char*)&v)) {
- memcpy(p, &effs, 4);;
- }
- p += sizeof(bob) - c;
- memcpy(p, &v, c);
+ strap_be(p, c, (char*)&bob, sizeof(bob));
if (is_le()) {
flip_endian(sizeof(int), (void*)&bob);
}