Commit f0cc7bda f0cc7bda9699c31f2c478928f78b16876db2fa25 by Sergey Poznyakoff

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'.
1 parent 50da8665
...@@ -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 }
......
...@@ -666,7 +666,7 @@ pop_section (struct scan_tree_data *dat) ...@@ -666,7 +666,7 @@ pop_section (struct scan_tree_data *dat)
666 { \ 666 { \
667 type sum = 0; \ 667 type sum = 0; \
668 \ 668 \
669 while (*s) \ 669 for (; *s; s++) \
670 { \ 670 { \
671 type x; \ 671 type x; \
672 \ 672 \
...@@ -690,7 +690,6 @@ pop_section (struct scan_tree_data *dat) ...@@ -690,7 +690,6 @@ pop_section (struct scan_tree_data *dat)
690 return 1; \ 690 return 1; \
691 } \ 691 } \
692 sum = x; \ 692 sum = x; \
693 *s++; \
694 } \ 693 } \
695 res = sum; \ 694 res = sum; \
696 } 695 }
......