diff options
Diffstat (limited to 'src/analysis/db/misc')
-rw-r--r-- | src/analysis/db/misc/Makefile.am | 11 | ||||
-rw-r--r-- | src/analysis/db/misc/rlestr.c | 15 |
2 files changed, 9 insertions, 17 deletions
diff --git a/src/analysis/db/misc/Makefile.am b/src/analysis/db/misc/Makefile.am index 6d4af6c..fc3cab2 100644 --- a/src/analysis/db/misc/Makefile.am +++ b/src/analysis/db/misc/Makefile.am @@ -6,18 +6,7 @@ libanalysisdbmisc_la_SOURCES = \ snapshot.h snapshot.c \ timestamp.h timestamp.c -libanalysisdbmisc_la_LIBADD = - -libanalysisdbmisc_la_LDFLAGS = - devdir = $(includedir)/chrysalide/$(subdir:src/%=core/%) dev_HEADERS = $(libanalysisdbmisc_la_SOURCES:%c=) - - -AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) $(LIBARCHIVE_CFLAGS) $(LIBSQLITE_CFLAGS) - -AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS) - -SUBDIRS = diff --git a/src/analysis/db/misc/rlestr.c b/src/analysis/db/misc/rlestr.c index bb81b55..a211723 100644 --- a/src/analysis/db/misc/rlestr.c +++ b/src/analysis/db/misc/rlestr.c @@ -29,6 +29,9 @@ #include <string.h> +#include "../../../common/leb128.h" + + /****************************************************************************** * * @@ -276,16 +279,16 @@ int cmp_rle_string(const rle_string *s1, const rle_string *s2) bool unpack_rle_string(rle_string *str, packed_buffer_t *pbuf) { bool result; /* Bilan à retourner */ - uint32_t tmp32; /* Valeur sur 32 bits */ + uleb128_t len; /* Quantité de caractères */ unset_rle_string(str); - result = extract_packed_buffer(pbuf, &tmp32, sizeof(uint32_t), true); - - str->length = tmp32; + result = unpack_uleb128(&len, pbuf); - if (result && str->length > 0) + if (result && len > 0) { + str->length = len; + str->data = malloc(str->length + 1); str->dynamic = true; @@ -321,7 +324,7 @@ bool pack_rle_string(const rle_string *str, packed_buffer_t *pbuf) { bool result; /* Bilan à retourner */ - result = extend_packed_buffer(pbuf, (uint32_t []) { str->length }, sizeof(uint32_t), true); + result = pack_uleb128((uleb128_t []){ str->length }, pbuf); if (result && str->length > 0) result = extend_packed_buffer(pbuf, str->data, str->length + 1, false); |