1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains source for the ZFormatNotice function.
4 * Created by: Robert French
6 * $Id: ZFmtNotice.c,v 1.17 1999/01/22 23:19:07 ghudson Exp $
8 * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
9 * For copying and distribution information, see the file
14 static char rcsid_ZFormatNotice_c[] = "$Id: ZFmtNotice.c,v 1.17 1999/01/22 23:19:07 ghudson Exp $";
19 Code_t ZFormatNotice(notice, buffer, ret_len, cert_routine)
20 register ZNotice_t *notice;
23 Z_AuthProc cert_routine;
25 char header[Z_MAXHEADERLEN];
29 if ((retval = Z_FormatHeader(notice, header, sizeof(header), &hdrlen,
30 cert_routine)) != ZERR_NONE)
33 *ret_len = hdrlen+notice->z_message_len;
35 /* Length can never be zero, don't have to worry about malloc(0). */
36 if (!(*buffer = (char *) malloc((unsigned)*ret_len)))
39 (void) memcpy(*buffer, header, hdrlen);
40 (void) memcpy(*buffer+hdrlen, notice->z_message, notice->z_message_len);