Skip to content

Commit

Permalink
Merge pull request #1250 from ampli/issue-1274
Browse files Browse the repository at this point in the history
A additional fix for issue  #1247 ++
  • Loading branch information
linas committed Sep 16, 2021
2 parents d57493e + 6e9c6e9 commit 251cfc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions link-grammar/disjunct-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ struct Disjunct_struct
{
struct
{
const char *word_string; /* Subscripted dictionary word */
float cost; /* Disjunct cost */
unsigned int is_category; /* Use the category field */
float cost; /* Disjunct cost */
const char *word_string; /* Subscripted dictionary word */
};
struct
{
/* Dictionary category & disjunct cost (for sentence generation). */
Category_cost *category;
unsigned int num_categories_alloced;
unsigned int num_categories;
unsigned int num_categories_alloced;
Category_cost *category;
};
};

Expand Down
2 changes: 1 addition & 1 deletion link-grammar/prepare/build-disjuncts.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ build_disjunct(Sentence sent, Clause * cl, const char * string,
{
ndis->num_categories_alloced = 4;
ndis->category =
malloc(sizeof(ndis->category) * ndis->num_categories_alloced);
malloc(sizeof(*ndis->category) * ndis->num_categories_alloced);
ndis->num_categories = 1;
ndis->category[0].num = strtol(string, NULL, 16);
ndis->category[1].num = 0; /* API array terminator */
Expand Down

0 comments on commit 251cfc4

Please sign in to comment.