version 1.5, 2025/03/22 18:43:54
|
version 1.7, 2025/04/10 01:24:38
|
Line 24
|
Line 24
|
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
* $Log$ |
* $Log$ |
|
* Revision 1.7 2025/04/10 01:24:38 snw |
|
* Remove C++ style comments |
|
* |
|
* Revision 1.6 2025/04/09 15:16:50 snw |
|
* Fix buffer overruns in mref_to_external and ssvn.c |
|
* |
* Revision 1.5 2025/03/22 18:43:54 snw |
* Revision 1.5 2025/03/22 18:43:54 snw |
* Make STRLEN 255 chars and add BIGSTR macro for larger buffers |
* Make STRLEN 255 chars and add BIGSTR macro for larger buffers |
* |
* |
Line 268 void mref_to_external (freem_ref_t *ref,
|
Line 274 void mref_to_external (freem_ref_t *ref,
|
} |
} |
|
|
} |
} |
stcnv_m2c (buf); |
stncnv_m2c (buf, STRLEN); |
|
|
strcat (buf, ")"); |
strcat (buf, ")"); |
|
|
Line 284 short mref_is_descendant(freem_ref_t *a,
|
Line 290 short mref_is_descendant(freem_ref_t *a,
|
{ |
{ |
register int i; |
register int i; |
|
|
//printf ("checking if %s is a descendant of %s\r\n", b->name, a->name); |
|
//printf ("a: %d b: %d\r\n", a->subscript_count, b->subscript_count); |
|
|
|
if (a->subscript_count > b->subscript_count) return FALSE; |
if (a->subscript_count > b->subscript_count) return FALSE; |
if ((strcmp (a->name, b->name) == 0) && (a->subscript_count == 0)) return TRUE; |
if ((strcmp (a->name, b->name) == 0) && (a->subscript_count == 0)) return TRUE; |
|
|
|
|
for (i = 0; i < a->subscript_count; i++) { |
for (i = 0; i < a->subscript_count; i++) { |
|
|
//printf("\ta[%d] = '%s'\r\n\tb[%d] = '%s'\r\n", i, a->subscripts[i], i, b->subscripts[i]); |
|
|
|
if (strcmp (b->subscripts[i], a->subscripts[i]) != 0 ) { |
if (strcmp (b->subscripts[i], a->subscripts[i]) != 0 ) { |
//printf ("not descendant [%d]\r\n", strcmp (b->subscripts[i], a->subscripts[i])); |
|
return FALSE; |
return FALSE; |
} |
} |
} |
} |
|
|
//printf ("is descendant\r\n"); |
|
|
|
return TRUE; |
return TRUE; |
} |
} |