(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:
10
appl/kx/kx.c
10
appl/kx/kx.c
@@ -31,6 +31,7 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule,
|
|||||||
struct hostent *hostent;
|
struct hostent *hostent;
|
||||||
int s;
|
int s;
|
||||||
u_char b;
|
u_char b;
|
||||||
|
char tmp[16];
|
||||||
|
|
||||||
hostent = gethostbyname (host);
|
hostent = gethostbyname (host);
|
||||||
if (hostent == NULL) {
|
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));
|
fprintf (stderr, "%s: write: %s\n", prog, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (read (s, &display_num, sizeof(display_num)) !=
|
|
||||||
sizeof(display_num)) {
|
if (krb_net_read (s, tmp, sizeof(tmp)) != sizeof(tmp)) {
|
||||||
fprintf (stderr, "%s: read: %s\n", prog,
|
fprintf (stderr, "%s: read %s\n", prog, strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
display_num = ntohl(display_num);
|
sscanf (tmp, "%u", &display_num);
|
||||||
if (read (s, xauthfile, sizeof(xauthfile)) != sizeof(xauthfile)) {
|
if (read (s, xauthfile, sizeof(xauthfile)) != sizeof(xauthfile)) {
|
||||||
fprintf (stderr, "%s: read: %s\n", prog,
|
fprintf (stderr, "%s: read: %s\n", prog,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
Reference in New Issue
Block a user