Skip to content

Commit

Permalink
Fix broken length calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed Sep 9, 2024
1 parent b72105d commit 0d78cf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/output/output_csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ typedef char *(*string_function_t)(char *, recordHandle_t *);
} while (0)

#define STREAMBUFFSIZE 4096
#define STREAMLEN(ptr) \
(ptr - streamBuff); \
#define STREAMLEN(ptr) \
((ptrdiff_t)STREAMBUFFSIZE - (ptr - streamBuff)); \
assert((ptr - streamBuff) < STREAMBUFFSIZE)
static char *streamBuff = NULL;

Expand Down
4 changes: 2 additions & 2 deletions src/output/output_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ static uint32_t recordCount = 0;
} while (0)

#define STREAMBUFFSIZE 4096
#define STREAMLEN(ptr) \
(ptr - streamBuff); \
#define STREAMLEN(ptr) \
((ptrdiff_t)STREAMBUFFSIZE - (ptr - streamBuff)); \
assert((ptr - streamBuff) < STREAMBUFFSIZE)
static char *streamBuff = NULL;

Expand Down
4 changes: 2 additions & 2 deletions src/output/output_ndjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ static uint32_t recordCount = 0;
} while (0)

#define STREAMBUFFSIZE 4096
#define STREAMLEN(ptr) \
(ptr - streamBuff); \
#define STREAMLEN(ptr) \
((ptrdiff_t)STREAMBUFFSIZE - (ptr - streamBuff)); \
assert((ptr - streamBuff) < STREAMBUFFSIZE)
static char *streamBuff = NULL;

Expand Down

0 comments on commit 0d78cf7

Please sign in to comment.