<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40064 >

My trivial patch was only meant to change an existing array from sentence
fragments for easier translation.  Then, it ballooned from fixed size to
variable, and fancier, and....

Used sizeof() instead of ARRAY_SIZE().  Fixed.

Excellent report with savegame!  Thanks!

Committed S2_2 revision 14366.
Committed trunk revision 14367.

Index: server/report.c
===================================================================
--- server/report.c     (revision 14365)
+++ server/report.c     (working copy)
@@ -234,11 +234,11 @@
   for (i = 0; i < j; i++) {
     if (i > 0 && size[i].value < size[i - 1].value) {
       /* since i < j, only top entry reigns Supreme */
-      rank = ((i * sizeof(ranking)) / j) + 1;
+      rank = ((i * ARRAY_SIZE(ranking)) / j) + 1;
     }
-    if (rank >= sizeof(ranking)) {
+    if (rank >= ARRAY_SIZE(ranking)) {
       /* clamp to final entry */
-      rank = sizeof(ranking) - 1;
+      rank = ARRAY_SIZE(ranking) - 1;
     }
     cat_snprintf(buffer, sizeof(buffer),
                 _(ranking[rank]),
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to