commit 8cf0e957550bdf5145869f7030ed3f9eca56b770
parent 74c0b07d220cb7839386c155a364916d3a4f9b32
Auteur: Loïc Daignault-Pichette <loic@asteride.xyz>
Date: Sun, 15 Feb 2026 14:55:08 -0500
Comparer la longueur des symboles
tfm_symb_chercher() vérifiait seulement si un symbole déjà ajouté était un
préfixe du symbole à chercher. Les symboles doivent maintenant avoir la même
longueur pour être considérés identiques.
Diffstat:
1 fichier modifié, 2 insertions(+), 2 suppressions(-)
diff --git a/tfm.c b/tfm.c
@@ -179,8 +179,8 @@ tfm_symb_chercher(struct tampinf *ti, char *symb, size_t lngr)
for (pos = 0; tampinf_dedans(ti, pos); pos += n) {
n = ((unsigned char *)ctn)[pos++];
- if (strncmp(symb, ctn + pos, n) == 0)
- return 0;
+ if (lngr == n && strncmp(symb, ctn + pos, n) == 0)
+ return pos-1;
}
return -1;