aboutsummaryrefslogtreecommitdiff
path: root/src/appl/simple/client/sim_client.c
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1991-04-19 16:21:21 +0000
committerJohn Kohl <jtkohl@mit.edu>1991-04-19 16:21:21 +0000
commitf1da4a9a4b4a91c49d1f1c159f72379f917fe74b (patch)
tree0bddde533eaa8c82f691d35c01b0d71876898616 /src/appl/simple/client/sim_client.c
parent96b90700e351787b6c24024c60459c22f84d950d (diff)
downloadkrb5-f1da4a9a4b4a91c49d1f1c159f72379f917fe74b.zip
krb5-f1da4a9a4b4a91c49d1f1c159f72379f917fe74b.tar.gz
krb5-f1da4a9a4b4a91c49d1f1c159f72379f917fe74b.tar.bz2
use MAXHOSTNAMELEN
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2016 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/simple/client/sim_client.c')
-rw-r--r--src/appl/simple/client/sim_client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/appl/simple/client/sim_client.c b/src/appl/simple/client/sim_client.c
index 4430940..d3b1eb8 100644
--- a/src/appl/simple/client/sim_client.c
+++ b/src/appl/simple/client/sim_client.c
@@ -28,10 +28,16 @@ static char rcsid_sim_client_c[] =
#include <krb5/krb5.h>
#include <krb5/ext-proto.h>
#include <krb5/los-proto.h>
+#include <krb5/sysincl.h>
#include <com_err.h>
#include "simple.h"
+/* for old Unixes and friends ... */
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif
+
#define MSG "hi there!" /* message text */
#define PROGNAME argv[0]
@@ -47,7 +53,7 @@ char *argv[];
struct servent *serv;
struct hostent *host;
char *cp;
- char full_hname[256]; /* XXX magic number */
+ char full_hname[MAXHOSTNAMELEN];
struct sockaddr_in s_sock; /* server address */
struct sockaddr_in c_sock; /* client address */
@@ -88,6 +94,7 @@ char *argv[];
exit(1);
}
strncpy(full_hname, host->h_name, sizeof(full_hname)-1);
+ full_hname[sizeof(full_hname)-1] = '\0';
/* lower-case to get name for "instance" part of service name */
for (cp = full_hname; *cp; cp++)