ControlScripts: fix matrix indexes in for constructs in parse_up_down_log.sh
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 16 Aug 2010 14:52:00 +0000 (17:52 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 16 Aug 2010 14:52:00 +0000 (17:52 +0300)
ControlScripts/parse_up_down_log.sh

index 8b78628..2ad8cea 100755 (executable)
@@ -97,8 +97,8 @@ BEGIN {
        }
        close("peer_index.cfg");
 
-       for (i = 0; i < num_peers; i++)
-               for (j = 0; j < num_peers; j++) {
+       for (i = 1; i <= num_peers; i++)
+               for (j = 1; j <= num_peers; j++) {
                        down_matrix[i,j] = 0;
                        up_matrix[i,j] = 0;
                }
@@ -123,8 +123,8 @@ BEGIN {
 }
 
 END {
-       for (i = 0; i < num_peers; i++) {
-               for (j = 0; j < num_peers; j++) {
+       for (i = 1; i <= num_peers; i++) {
+               for (j = 1; j <= num_peers; j++) {
                        if (down_matrix[i,j] == 0)
                                printf "0 " >> down_output_file;
                        else