Skip to content

Commit 20016aa

Browse files
committed
Fix multiple empty strings
1 parent b72d3c7 commit 20016aa

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

include/siri/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#define SIRIDB_VERSION_MAJOR 2
88
#define SIRIDB_VERSION_MINOR 0
9-
#define SIRIDB_VERSION_PATCH 51
9+
#define SIRIDB_VERSION_PATCH 52
1010

1111
/*
1212
* Use SIRIDB_VERSION_PRE_RELEASE for alpha release versions.
@@ -15,7 +15,7 @@
1515
* Note that debian alpha packages should use versions like this:
1616
* 2.0.34-0alpha0
1717
*/
18-
#define SIRIDB_VERSION_PRE_RELEASE ""
18+
#define SIRIDB_VERSION_PRE_RELEASE "-alpha-0"
1919

2020
#ifndef NDEBUG
2121
#define SIRIDB_VERSION_BUILD_RELEASE "+debug"

src/siri/db/points.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,6 @@ static int POINTS_unpack_string(
11181118
{
11191119
/* literal */
11201120
size_t len = (is_ascii) ? 0 : POINTS_dec_len(&pt);
1121-
11221121
do
11231122
{
11241123
*buf = *pt;
@@ -1228,12 +1227,6 @@ int siridb_points_unzip_string(
12281227
memcpy(&point->ts, pt, sizeof(uint64_t));
12291228
pt += sizeof(uint64_t);
12301229

1231-
buf = malloc(src_sz);
1232-
if (buf == NULL)
1233-
{
1234-
return -1;
1235-
}
1236-
12371230
for (mask = 0; tshift-- > tcount; ++pt)
12381231
{
12391232
mask |= ((uint64_t) *pt) << (tshift * 8);
@@ -1265,6 +1258,12 @@ int siridb_points_unzip_string(
12651258

12661259
n -= i;
12671260

1261+
buf = malloc(src_sz + n);
1262+
if (buf == NULL)
1263+
{
1264+
return -1;
1265+
}
1266+
12681267
if (POINTS_unpack_string(
12691268
points->data + points->len, n, i, bits + offset, buf))
12701269
{

0 commit comments

Comments
 (0)