summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/hash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/hash.c b/lib/hash.c
index 80e44af..207439d 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -19,7 +19,7 @@ static int FonctionHachage(char *clef)
return (i);
}
}
- return -1;
+ return strlen(CHAINEHACHAGE);
}
_Element CreerElement(char *Nom, _TypeVariable Var)
@@ -95,7 +95,7 @@ char SupprimerDansTab(_TableauVariable * t, char *Nom)
{
int index = FonctionHachage(Nom);
- if (0 <= index && index < strlen(CHAINEHACHAGE)) {
+ if (0 <= index && index <= strlen(CHAINEHACHAGE)) {
Supprimer(&((*t)[index]), Nom);
} else {
return (0);
@@ -107,7 +107,7 @@ char InsererVarDansTab(_TableauVariable * t, _Element e)
{
int index = FonctionHachage(e.NomVar);
- if (0 <= index && index < strlen(CHAINEHACHAGE)) {
+ if (0 <= index && index <= strlen(CHAINEHACHAGE)) {
(*t)[index] = InserTete((*t)[index], e);
} else {
return (0);
@@ -159,7 +159,7 @@ int Initialise(_TableauVariable * t)
unsigned int i;
(*t) = (_TableauVariable) Emalloc(sizeof(_ListeChaine) * (strlen(CHAINEHACHAGE) + 1));
- for (i = 0; i < strlen(CHAINEHACHAGE); i++) {
+ for (i = 0; i <= strlen(CHAINEHACHAGE); i++) {
(*t)[i] = NULL;
}
return (i);
@@ -169,7 +169,7 @@ void DetruitTab(_TableauVariable * t)
{
int i;
- for (i = 0; i < strlen(CHAINEHACHAGE); i++) {
+ for (i = 0; i <= strlen(CHAINEHACHAGE); i++) {
Detruit(&((*t)[i]));
}