Skip to content

Commit 55fbf97

Browse files
Merge pull request #2316 from mezzarobba/fix_check_duplicates
gr_set_str with duplicate generator names (ter)
2 parents 726ee2d + cef3abb commit 55fbf97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gr_generic/set_str_expr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ int _gr_parse_check_duplicates(gr_parse_t E)
244244
int ok = 1;
245245
for (slong k = 1; k < E->terminals_len; k++)
246246
{
247-
if (!strncmp(names[k-1].str, E->terminal_strings[k].str,
248-
names[k-1].str_len))
247+
if (names[k].str_len == names[k - 1].str_len &&
248+
!strncmp(names[k - 1].str, names[k].str, names[k-1].str_len))
249249
{
250250
ok = 0;
251251
break;

0 commit comments

Comments
 (0)