version 1.10, 2000/12/07 19:36:37 |
version 1.11, 2001/06/05 21:27:16 |
|
|
if (spev[i].uname != NULL) |
if (spev[i].uname != NULL) |
free(spev[i].uname); |
free(spev[i].uname); |
if ((spev[i].uname = strdup(p)) == NULL) |
if ((spev[i].uname = strdup(p)) == NULL) |
errx(1, "cannot allocate memory"); |
err(1, NULL); |
spev[i].ulen = strlen(p); |
spev[i].ulen = strlen(p); |
i = NUMEV + 1; |
i = NUMEV + 1; |
} |
} |
|
|
while (m) { |
while (m) { |
cur_evt = (struct event *) malloc(sizeof(struct event)); |
cur_evt = (struct event *) malloc(sizeof(struct event)); |
if (cur_evt == NULL) |
if (cur_evt == NULL) |
errx(1, "cannot allocate memory"); |
err(1, NULL); |
|
|
cur_evt->when = m->when; |
cur_evt->when = m->when; |
snprintf(cur_evt->print_date, |
snprintf(cur_evt->print_date, |
|
|
cur_evt->ldesc = NULL; |
cur_evt->ldesc = NULL; |
} else { |
} else { |
if ((cur_evt->ldesc = strdup(p)) == NULL) |
if ((cur_evt->ldesc = strdup(p)) == NULL) |
errx(1, "cannot allocate memory"); |
err(1, NULL); |
cur_evt->desc = &(cur_evt->ldesc); |
cur_evt->desc = &(cur_evt->ldesc); |
ev1 = cur_evt; |
ev1 = cur_evt; |
} |
} |
|
|
else if (printing) { |
else if (printing) { |
if ((ev1->ldesc = realloc(ev1->ldesc, |
if ((ev1->ldesc = realloc(ev1->ldesc, |
(2 + strlen(ev1->ldesc) + strlen(buf)))) == NULL) |
(2 + strlen(ev1->ldesc) + strlen(buf)))) == NULL) |
errx(1, "cannot allocate memory"); |
err(1, NULL); |
strcat(ev1->ldesc, "\n"); |
strcat(ev1->ldesc, "\n"); |
strcat(ev1->ldesc, buf); |
strcat(ev1->ldesc, buf); |
} |
} |