Bugfixes.
* mailbox/assoc.c (assoc_remove): Fix incorrect copying between assoc slots. * mailbox/cfg_parser.y (STRTONUM): Remove useless dereferencing. Change the loop from `while' to `for'.
Showing
2 changed files
with
3 additions
and
1 deletions
... | @@ -173,7 +173,9 @@ assoc_remove (mu_assoc_t assoc, struct _mu_assoc_elem *elem) | ... | @@ -173,7 +173,9 @@ assoc_remove (mu_assoc_t assoc, struct _mu_assoc_elem *elem) |
173 | } | 173 | } |
174 | while ((j < r && r <= i) || (i < j && j < r) || (r <= i && i < j)); | 174 | while ((j < r && r <= i) || (i < j && j < r) || (r <= i && i < j)); |
175 | 175 | ||
176 | *ASSOC_ELEM (assoc, j) = *ASSOC_ELEM (assoc, i); | 176 | if (j != i) |
177 | memcpy (ASSOC_ELEM (assoc, j), ASSOC_ELEM (assoc, i), | ||
178 | assoc->elsize); | ||
177 | } | 179 | } |
178 | return 0; | 180 | return 0; |
179 | } | 181 | } | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment