| 119 | } |
| 120 | |
| 121 | static void NetStatAdd(char *text) |
| 122 | { |
| 123 | int x; |
| 124 | uint32 totallen = 0; |
| 125 | char *textbuf; |
| 126 | |
| 127 | if(!netwin) return; |
| 128 | if(netstattcount>=64) free(netstatt[netstattcount&63]); |
| 129 | |
| 130 | if(!(netstatt[netstattcount&63]=(char*)malloc(strlen(text)+1))) //mbg merge 7/17/06 added cast |
| 131 | return; |
| 132 | strcpy(netstatt[netstattcount&63],text); |
| 133 | netstattcount++; |
| 134 | |
| 135 | if(netstattcount>=64) |
| 136 | { |
| 137 | for(x=netstattcount&63;;) |
| 138 | { |
| 139 | totallen += strlen(netstatt[x]); |
| 140 | x=(x+1)&63; |
| 141 | if(x==(netstattcount&63)) break; |
| 142 | totallen += 2; |
| 143 | } |
| 144 | |
| 145 | totallen++; // NULL |
| 146 | textbuf = (char *)malloc(totallen); //mbg merge 7/17/06 added cast |
| 147 | textbuf[0] = 0; |
| 148 | |
| 149 | for(x=netstattcount&63;;) |
| 150 | { |
| 151 | strcat(textbuf,netstatt[x]); |
| 152 | x=(x+1)&63; |
| 153 | if(x==(netstattcount&63)) break; |
| 154 | strcat(textbuf,"\r\n"); |
| 155 | } |
| 156 | } |
| 157 | else |
| 158 | { |
| 159 | for(x=0;x<netstattcount;x++) |
| 160 | { |
| 161 | totallen += strlen(netstatt[x]); |
| 162 | if(x<(netstattcount-1)) |
| 163 | totallen += 2; |
| 164 | } |
| 165 | totallen++; |
| 166 | textbuf = (char*)malloc(totallen); //mbg merge 7/17/06 added cast |
| 167 | textbuf[0] = 0; |
| 168 | for(x=0;x<netstattcount;x++) |
| 169 | { |
| 170 | strcat(textbuf,netstatt[x]); |
| 171 | if(x<(netstattcount-1)) |
| 172 | strcat(textbuf,"\r\n"); |
| 173 | } |
| 174 | } |
| 175 | SetDlgItemText(netwin,IDC_NETMOO_STATUS,textbuf); |
| 176 | free(textbuf); |
| 177 | SendDlgItemMessage(netwin,IDC_NETMOO_STATUS,EM_LINESCROLL,0,32767); |
| 178 | } |
no outgoing calls
no test coverage detected