1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains source for the ZFormatNoticeList function.
4 * Created by: Robert French
8 * Copyright (c) 1987,1991 by the Massachusetts Institute of Technology.
9 * For copying and distribution information, see the file
16 static const char rcsid_ZFormatNoticeList_c[] =
21 ZFormatNoticeList(ZNotice_t *notice,
26 Z_AuthProc cert_routine)
28 char header[Z_MAXHEADERLEN];
34 if ((retval = Z_FormatHeader(notice, header, sizeof(header), &hdrlen,
35 cert_routine)) != ZERR_NONE)
39 for (i=0;i<nitems;i++)
40 size += strlen(list[i])+1;
42 *ret_len = hdrlen+size;
44 /* *ret_len can never be zero here, no need to worry about malloc(0). */
45 if (!(*buffer = (char *) malloc((unsigned)*ret_len)))
48 (void) memcpy(*buffer, header, hdrlen);
52 for (;nitems;nitems--, list++) {
54 (void) memcpy(ptr, *list, i);