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[] =
20 Code_t ZFormatNoticeList(notice, list, nitems, buffer, ret_len,
27 Z_AuthProc cert_routine;
29 char header[Z_MAXHEADERLEN];
35 if ((retval = Z_FormatHeader(notice, header, sizeof(header), &hdrlen,
36 cert_routine)) != ZERR_NONE)
40 for (i=0;i<nitems;i++)
41 size += strlen(list[i])+1;
43 *ret_len = hdrlen+size;
45 /* *ret_len can never be zero here, no need to worry about malloc(0). */
46 if (!(*buffer = (char *) malloc((unsigned)*ret_len)))
49 (void) memcpy(*buffer, header, hdrlen);
53 for (;nitems;nitems--, list++) {
55 (void) memcpy(ptr, *list, i);