Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/readstat_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ static int readstat_compare_string_refs(const void *elem1, const void *elem2) {
readstat_string_ref_t *ref1 = *(readstat_string_ref_t **)elem1;
readstat_string_ref_t *ref2 = *(readstat_string_ref_t **)elem2;

if (ref1->first_v == ref2->first_v)
return ref1->first_o - ref2->first_o;
if (ref1->first_o == ref2->first_o)
return ref1->first_v - ref2->first_v;

return ref1->first_v - ref2->first_v;
return ref1->first_o - ref2->first_o;
}

readstat_string_ref_t *readstat_string_ref_init(const char *string) {
Expand Down
6 changes: 3 additions & 3 deletions src/stata/readstat_dta_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ static readstat_error_t dta_read_tag(dta_ctx_t *ctx, const char *tag) {
static int dta_compare_strls(const void *elem1, const void *elem2) {
const dta_strl_t *key = (const dta_strl_t *)elem1;
const dta_strl_t *target = *(const dta_strl_t **)elem2;
if (key->v == target->v)
return key->o - target->o;
if (key->o == target->o)
return key->v - target->v;

return key->v - target->v;
return key->o - target->o;
}

static dta_strl_t dta_interpret_strl_vo_bytes(dta_ctx_t *ctx, const unsigned char *vo_bytes) {
Expand Down