Changeset b0430a6 for message.c


Ignore:
Timestamp:
Dec 21, 2003, 8:19:14 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:
2de4f20
Parents:
72836b5
Message:
New zephyr_get_field function
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r5a95b69 rb0430a6  
    714714{
    715715  struct hostent *hent;
    716   int k, len;
    717716  char *ptr, *tmp, *tmp2;
    718717
     
    755754  if (!strcasecmp(n->z_class, "login") || !strcasecmp(n->z_class, OWL_WEBZEPHYR_CLASS)) {
    756755    if (!strcasecmp(n->z_opcode, "user_login") || !strcasecmp(n->z_opcode, "user_logout")) {
    757       ptr=owl_zephyr_get_field(n, 1, &len);
    758       tmp=owl_malloc(len+10);
    759       strncpy(tmp, ptr, len);
    760       tmp[len]='\0';
     756      tmp=owl_zephyr_get_field(n, 1);
    761757      owl_message_set_attribute(m, "loginhost", tmp);
    762758      owl_free(tmp);
    763759
    764       ptr=owl_zephyr_get_field(n, 3, &len);
    765       tmp=owl_malloc(len+10);
    766       strncpy(tmp, ptr, len);
    767       tmp[len]='\0';
     760      tmp=owl_zephyr_get_field(n, 3);
    768761      owl_message_set_attribute(m, "logintty", tmp);
    769762      owl_free(tmp);
     
    786779
    787780  /* set the body */
    788   ptr=owl_zephyr_get_message(n, &k);
    789   tmp=owl_malloc(k+10);
    790   memcpy(tmp, ptr, k);
    791   tmp[k]='\0';
     781  tmp=owl_zephyr_get_message(n);
    792782  if (owl_global_is_newlinestrip(&g)) {
    793783    tmp2=owl_util_stripnewlines(tmp);
Note: See TracChangeset for help on using the changeset viewer.