@@ -108,7 +108,7 @@ size_t network_count_inactive(const Network network) {
108108 }
109109
110110 size_t counter = 0 ;
111- for (size_t i = 0 ; i <= network .device_count ; i ++ ) {
111+ for (size_t i = 0 ; i < network .device_count ; i ++ ) {
112112 if (network .devices [i ].status == INACTIVE ) {
113113 counter ++ ;
114114 }
@@ -117,14 +117,14 @@ size_t network_count_inactive(const Network network) {
117117}
118118
119119void network_set_dead (Network network ) {
120- for (size_t i = 0 ;i <= network .device_count ;i ++ ) {
120+ for (size_t i = 0 ;i < network .device_count ;i ++ ) {
121121 network .devices [i ].alive = false;
122122 }
123123}
124124
125125size_t network_count_alive_or_jammed (Network network ) {
126126 size_t counter = 0 ;
127- for (size_t i = 0 ;i <= network .device_count ;i ++ ) {
127+ for (size_t i = 0 ;i < network .device_count ;i ++ ) {
128128 if (network .devices [i ].alive || network .devices [i ].status == JAMMING || network .devices [i ].status == DISCONNECTING ) {
129129 counter ++ ;
130130 }
@@ -164,7 +164,7 @@ DeviceGroup print_network_nice(Network network, size_t offset, size_t max_visibl
164164 printf (" %3s %-15s %-17s %-6s %-7s\n" , "ID" , "IP" , "MAC" , "Alive" , "Jamming" );
165165 printf ("───────────────────────────────────────────────────────────────\n" );
166166
167- for (size_t i = 0 ; i <= network .device_count ; i ++ ) {
167+ for (size_t i = 0 ; i < network .device_count ; i ++ ) {
168168 if (network .devices [i ].alive || network .devices [i ].status == JAMMING || network .devices [i ].status == DISCONNECTING ) {
169169 group .devices [idx ++ ] = & network .devices [i ];
170170 }
0 commit comments