Output AL status code zero.
authorFlorian Pose <fp@igh-essen.com>
Tue, 19 Feb 2008 14:05:59 +0000
changeset 798 5a58606726f3
parent 797 1c2726f9c81b
child 799 068a58b96965
Output AL status code zero.
master/fsm_change.c
--- a/master/fsm_change.c	Tue Feb 19 14:05:26 2008 +0000
+++ b/master/fsm_change.c	Tue Feb 19 14:05:59 2008 +0000
@@ -389,18 +389,16 @@
     if (datagram->working_counter != 1) {
         EC_WARN("Reception of AL status code datagram failed: ");
         ec_datagram_print_wc_error(datagram);
-    }
-    else {
-        if ((code = EC_READ_U16(datagram->data))) {
-            for (al_msg = al_status_messages; al_msg->code; al_msg++) {
-                if (al_msg->code != code) continue;
-                EC_ERR("AL status message 0x%04X: \"%s\".\n",
-                       al_msg->code, al_msg->message);
-                break;
-            }
-            if (!al_msg->code)
-                EC_ERR("Unknown AL status code 0x%04X.\n", code);
+    } else {
+        code = EC_READ_U16(datagram->data);
+        for (al_msg = al_status_messages; al_msg->code; al_msg++) {
+            if (al_msg->code != code) continue;
+            EC_ERR("AL status message 0x%04X: \"%s\".\n",
+                    al_msg->code, al_msg->message);
+            break;
         }
+        if (!al_msg->code)
+            EC_ERR("Unknown AL status code 0x%04X.\n", code);
     }
 
     // acknowledge "old" slave state