summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar John F. Carr <jfc@mit.edu>1991-06-20 10:29:34 +0000
committerGravatar John F. Carr <jfc@mit.edu>1991-06-20 10:29:34 +0000
commitd05d40e06a19f489137bfeb49a75ee2d750e95d6 (patch)
tree05eda21f28d15d4f56dbc11536830676d5d4fcef
parentcabba5b3d377234981408eea3f04a85fb7b8bcde (diff)
Add register declaration.
-rw-r--r--lib/ZFmtList.c12
-rw-r--r--lib/ZFmtRaw.c9
-rw-r--r--lib/ZMkAuth.c6
3 files changed, 13 insertions, 14 deletions
diff --git a/lib/ZFmtList.c b/lib/ZFmtList.c
index bc3ae4d..95e5e52 100644
--- a/lib/ZFmtList.c
+++ b/lib/ZFmtList.c
@@ -14,24 +14,23 @@
#ifndef lint
static char rcsid_ZFormatNoticeList_c[] =
- "$Header$";
+ "$Id$";
#endif
-#include <zephyr/mit-copyright.h>
-
#include <zephyr/zephyr_internal.h>
Code_t ZFormatNoticeList(notice, list, nitems, buffer, ret_len,
cert_routine)
ZNotice_t *notice;
- char **list;
+ register char **list;
int nitems;
char **buffer;
int *ret_len;
Z_AuthProc cert_routine;
{
char header[Z_MAXHEADERLEN];
- int hdrlen, i, size;
+ register int i;
+ int hdrlen, size;
char *ptr;
Code_t retval;
@@ -44,7 +43,8 @@ Code_t ZFormatNoticeList(notice, list, nitems, buffer, ret_len,
size += strlen(list[i])+1;
*ret_len = hdrlen+size;
-
+
+ /* *ret_len can never be zero here, no need to worry about malloc(0). */
if (!(*buffer = malloc((unsigned)*ret_len)))
return (ENOMEM);
diff --git a/lib/ZFmtRaw.c b/lib/ZFmtRaw.c
index cebf7c2..05b230b 100644
--- a/lib/ZFmtRaw.c
+++ b/lib/ZFmtRaw.c
@@ -13,15 +13,13 @@
/* $Header$ */
#ifndef lint
-static char rcsid_ZFormatRawNotice_c[] = "$Header$";
-#endif lint
-
-#include <zephyr/mit-copyright.h>
+static char rcsid_ZFormatRawNotice_c[] = "$Id$";
+#endif
#include <zephyr/zephyr_internal.h>
Code_t ZFormatRawNotice(notice, buffer, ret_len)
- ZNotice_t *notice;
+ register ZNotice_t *notice;
char **buffer;
int *ret_len;
{
@@ -35,6 +33,7 @@ Code_t ZFormatRawNotice(notice, buffer, ret_len)
*ret_len = hdrlen+notice->z_message_len;
+ /* *ret_len is never 0, don't have to worry about malloc(0) */
if (!(*buffer = malloc((unsigned) *ret_len)))
return (ENOMEM);
diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c
index 0b20a39..7b11a34 100644
--- a/lib/ZMkAuth.c
+++ b/lib/ZMkAuth.c
@@ -14,9 +14,8 @@
#ifndef lint
static char rcsid_ZMakeAuthentication_c[] = "$Id$";
-#endif lint
+#endif
-#include <zephyr/mit-copyright.h>
#include <zephyr/zephyr_internal.h>
#ifdef KERBEROS
#include "krb_err.h"
@@ -32,7 +31,7 @@ Code_t ZResetAuthentication () {
}
Code_t ZMakeAuthentication(notice, buffer, buffer_len, len)
- ZNotice_t *notice;
+ register ZNotice_t *notice;
char *buffer;
int buffer_len;
int *len;
@@ -59,6 +58,7 @@ Code_t ZMakeAuthentication(notice, buffer, buffer_len, len)
notice->z_auth = 1;
notice->z_authent_len = authent.length;
notice->z_ascii_authent = (char *)malloc((unsigned)authent.length*3);
+ /* zero length authent is an error, so malloc(0) is not a problem */
if (!notice->z_ascii_authent)
return (ENOMEM);
if ((retval = ZMakeAscii(notice->z_ascii_authent,