Author: sveinung
Date: Wed Mar 22 12:08:06 2017
New Revision: 35145

URL: http://svn.gna.org/viewcvs/freeciv?rev=35145&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:
    branches/S3_0/server/savegame3.c

Modified: branches/S3_0/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/server/savegame3.c?rev=35145&r1=35144&r2=35145&view=diff
==============================================================================
--- branches/S3_0/server/savegame3.c    (original)
+++ branches/S3_0/server/savegame3.c    Wed Mar 22 12:08:06 2017
@@ -5787,6 +5787,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