repositories
/
Algorithmic_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
TP5: Properly guard against NULL testing an element in the searching
[Algorithmic_C.git]
/
TP5
/
exo4
/
liste_chainee.c
diff --git
a/TP5/exo4/liste_chainee.c
b/TP5/exo4/liste_chainee.c
index b21ad04a501b051e71c3ab463672fd364e3f9d0d..96baad731bc28a9c2327ea83758395dd0c060638 100644
(file)
--- a/
TP5/exo4/liste_chainee.c
+++ b/
TP5/exo4/liste_chainee.c
@@
-99,9
+99,9
@@
bool rechercher_iter(element e, Liste L)
while (L != NULL && L->valeur != e) {
L = L->suivant;
+ if (L->valeur == e)
+ rt_val = true;
}
- if (L->valeur == e)
- rt_val = true;
return rt_val;
}