Author: sveinung
Date: Wed Mar 22 12:01:41 2017
New Revision: 35141

URL: http://svn.gna.org/viewcvs/freeciv?rev=35141&view=rev
Log:
Document "able to save all actions" assertion.

Document the absence of an off by one error in the assertion that all
actions can be saved in a unit order.

See hrm Bug #645817

Modified:
    trunk/server/savegame3.c

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=35141&r1=35140&r2=35141&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Wed Mar 22 12:01:41 2017
@@ -5807,6 +5807,10 @@
         case ORDER_PERFORM_ACTION:
           action_buf[j] = num2char(punit->orders.list[j].action);
           /* Encoding with num2char() limits the number of actions. */
+          /* Note: <= is the correct operator. ACTION_COUNT is number of
+           * actions (the last action + 1). strlen(num_chars) is the number
+           * of chars (the last char + 1). The assert is supposed to be
+           * true. */
           FC_STATIC_STRLEN_ASSERT(ACTION_COUNT <= strlen(num_chars),
                                   can_not_encode_all_actions);
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to