(connect_host): write display_number in ascii.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@749 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-09-16 00:00:12 +00:00
parent cb41a1ee9b
commit 4cff2498aa

View File

@@ -31,6 +31,7 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule,
struct hostent *hostent;
int s;
u_char b;
char tmp[16];
hostent = gethostbyname (host);
if (hostent == NULL) {
@@ -88,13 +89,12 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule,
fprintf (stderr, "%s: write: %s\n", prog, strerror(errno));
return -1;
}
if (read (s, &display_num, sizeof(display_num)) !=
sizeof(display_num)) {
fprintf (stderr, "%s: read: %s\n", prog,
strerror(errno));
if (krb_net_read (s, tmp, sizeof(tmp)) != sizeof(tmp)) {
fprintf (stderr, "%s: read %s\n", prog, strerror(errno));
return -1;
}
display_num = ntohl(display_num);
sscanf (tmp, "%u", &display_num);
if (read (s, xauthfile, sizeof(xauthfile)) != sizeof(xauthfile)) {
fprintf (stderr, "%s: read: %s\n", prog,
strerror(errno));