… | |
… | |
244 | level = 0; |
244 | level = 0; |
245 | while (fgets (buf, MAX_BUF, fp) != NULL) |
245 | while (fgets (buf, MAX_BUF, fp) != NULL) |
246 | { |
246 | { |
247 | if (*buf == '#') |
247 | if (*buf == '#') |
248 | continue; |
248 | continue; |
|
|
249 | |
249 | if ((cp = strchr (buf, '\n')) != NULL) |
250 | if ((cp = strchr (buf, '\n')) != NULL) |
250 | *cp = '\0'; |
251 | *cp = '\0'; |
|
|
252 | |
251 | cp = buf; |
253 | cp = buf; |
252 | while (*cp == ' ') /* Skip blanks */ |
254 | while (*cp == ' ') /* Skip blanks */ |
253 | cp++; |
255 | cp++; |
254 | |
256 | |
255 | if (strncmp (cp, "TYPE:", 5) == 0) |
257 | if (strncmp (cp, "TYPE:", 5) == 0) |
… | |
… | |
261 | attack_mess[mess][level].level = -1; |
263 | attack_mess[mess][level].level = -1; |
262 | attack_mess[mess][level].buf1 = NULL; |
264 | attack_mess[mess][level].buf1 = NULL; |
263 | attack_mess[mess][level].buf2 = NULL; |
265 | attack_mess[mess][level].buf2 = NULL; |
264 | attack_mess[mess][level].buf3 = NULL; |
266 | attack_mess[mess][level].buf3 = NULL; |
265 | } |
267 | } |
|
|
268 | |
266 | level = 0; |
269 | level = 0; |
267 | mess = atoi (p); |
270 | mess = atoi (p); |
268 | mode = 1; |
271 | mode = 1; |
269 | continue; |
272 | continue; |
270 | } |
273 | } |
|
|
274 | |
271 | if (mode == 1) |
275 | if (mode == 1) |
272 | { |
276 | { |
273 | p = strtok (buf, "="); |
277 | p = strtok (buf, "="); |
274 | attack_mess[mess][level].level = atoi (buf); |
278 | attack_mess[mess][level].level = atoi (buf); |
275 | p = strtok (NULL, "="); |
279 | p = strtok (NULL, "="); |
… | |
… | |
305 | level++; |
309 | level++; |
306 | total++; |
310 | total++; |
307 | continue; |
311 | continue; |
308 | } |
312 | } |
309 | } |
313 | } |
|
|
314 | |
310 | LOG (llevDebug, "got %d messages in %d categories.\n", total, mess + 1); |
315 | LOG (llevDebug, "got %d messages in %d categories.\n", total, mess + 1); |
311 | close_and_delete (fp, comp); |
316 | close_and_delete (fp, comp); |
312 | } |
317 | } |
|
|
318 | |