Changeset e6449bc for logging.c


Ignore:
Timestamp:
Jul 2, 2003, 8:15:04 PM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
210c261
Parents:
03955f3
Message:
Owl should build now without zephyr, enabling it to act as a
  standalone AIM client.
Cleaned up some warnings from linux gcc.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • logging.c

    r09489b89 re6449bc  
    1010  FILE *file;
    1111  char filename[MAXPATHLEN], *logpath;
    12   char *tobuff, *ptr;
     12  char *tobuff, *ptr="";
    1313
    1414  tobuff=owl_malloc(strlen(to)+20);
     
    9797  FILE *file, *allfile;
    9898  char filename[MAXPATHLEN], allfilename[MAXPATHLEN], *logpath;
    99   char *frombuff, *ptr, *from, *buff, *tmp;
     99  char *frombuff=NULL, *from=NULL, *buff=NULL, *ptr;
    100100  int len, ch, i, personal;
    101101     
     
    140140    /* we do not yet handle chat rooms */
    141141    from=frombuff=owl_sprintf("aim:%s", owl_message_get_sender(m));
     142  } else {
     143    from=frombuff=owl_strdup("unknown");
    142144  }
    143145 
     
    193195  /* write to the main file */
    194196  if (owl_message_is_type_zephyr(m)) {
     197    char *tmp;
     198   
    195199    tmp=short_zuser(owl_message_get_sender(m));
    196200    fprintf(file, "Class: %s Instance: %s", owl_message_get_class(m), owl_message_get_instance(m));
     
    204208    fprintf(file, "From: %s <%s>\n\n", buff, tmp);
    205209    fprintf(file, "%s\n", owl_message_get_body(m));
     210    owl_free(tmp);
    206211  } else if (owl_message_is_type_aim(m) && !owl_message_is_loginout(m)) {
    207212    fprintf(file, "From: <%s> To: <%s>\n", owl_message_get_sender(m), owl_message_get_recipient(m));
     
    219224  if (personal) {
    220225    if (owl_message_is_type_zephyr(m)) {
     226      char *tmp;
     227
     228      tmp=short_zuser(owl_message_get_sender(m));
    221229      fprintf(allfile, "Class: %s Instance: %s", owl_message_get_class(m), owl_message_get_instance(m));
    222230      if (strcmp(owl_message_get_opcode(m), "")) fprintf(allfile, " Opcode: %s", owl_message_get_opcode(m));
     
    225233      fprintf(allfile, "From: %s <%s>\n\n", buff, tmp);
    226234      fprintf(allfile, "%s\n", owl_message_get_body(m));
     235      owl_free(tmp);
    227236    } else if (owl_message_is_type_aim(m) && !owl_message_is_loginout(m)) {
    228237      fprintf(allfile, "From: <%s> To: <%s>\n", owl_message_get_sender(m), owl_message_get_recipient(m));
     
    239248
    240249  if (owl_message_is_type_zephyr(m)) {
    241     owl_free(tmp);
    242250    owl_free(buff);
    243251  }
Note: See TracChangeset for help on using the changeset viewer.