- Timestamp:
- Mar 28, 2009, 5:00:34 PM (15 years ago)
- Branches:
- owl
- Children:
- 4de643d
- Parents:
- 5189631
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
logging.c
r3c7d086a rdab82f29 1 /* Copyright (c) 2002,2003,2004,2009 James M. Kretchmar 2 * 3 * This file is part of Owl. 4 * 5 * Owl is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * Owl is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with Owl. If not, see <http://www.gnu.org/licenses/>. 17 * 18 * --------------------------------------------------------------- 19 * 20 * As of Owl version 2.1.12 there are patches contributed by 21 * developers of the the branched BarnOwl project, Copyright (c) 22 * 2006-2008 The BarnOwl Developers. All rights reserved. 23 */ 24 1 25 #include "owl.h" 2 26 #include <stdlib.h> … … 13 37 void owl_log_message(owl_message *m) { 14 38 owl_function_debugmsg("owl_log_message: entering"); 15 16 if (m == NULL) {17 owl_function_debugmsg("owl_log_message: passed null message");18 return;19 }20 39 21 40 /* should we be logging this message? */ … … 281 300 FILE *file, *allfile; 282 301 char filename[MAXPATHLEN], allfilename[MAXPATHLEN], *logpath; 283 char *frombuff=NULL, *from=NULL, * buff=NULL, *ptr;302 char *frombuff=NULL, *from=NULL, *zsig=NULL; 284 303 int len, ch, i, personal; 285 304 … … 377 396 fprintf(file, "\n"); 378 397 fprintf(file, "Time: %s Host: %s\n", owl_message_get_timestr(m), owl_message_get_hostname(m)); 379 ptr=owl_zephyr_get_zsig(owl_message_get_notice(m), &i); 380 buff=owl_malloc(i+10); 381 memcpy(buff, ptr, i); 382 buff[i]='\0'; 383 fprintf(file, "From: %s <%s>\n\n", buff, tmp); 398 zsig=owl_message_get_zsig(m); 399 fprintf(file, "From: %s <%s>\n\n", zsig, tmp); 384 400 fprintf(file, "%s\n\n", owl_message_get_body(m)); 385 401 owl_free(tmp); … … 411 427 fprintf(allfile, "\n"); 412 428 fprintf(allfile, "Time: %s Host: %s\n", owl_message_get_timestr(m), owl_message_get_hostname(m)); 413 fprintf(allfile, "From: %s <%s>\n\n", buff, tmp);429 fprintf(allfile, "From: %s <%s>\n\n", zsig, tmp); 414 430 fprintf(allfile, "%s\n\n", owl_message_get_body(m)); 415 431 owl_free(tmp); … … 431 447 } 432 448 433 if (owl_message_is_type_zephyr(m)) {434 owl_free(buff);435 }436 449 owl_free(frombuff); 437 450 }
Note: See TracChangeset
for help on using the changeset viewer.