diff options
Diffstat (limited to 'libc/inet/rpc/xdr_stdio.c')
-rw-r--r-- | libc/inet/rpc/xdr_stdio.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libc/inet/rpc/xdr_stdio.c b/libc/inet/rpc/xdr_stdio.c index 8bd08590d..32689e132 100644 --- a/libc/inet/rpc/xdr_stdio.c +++ b/libc/inet/rpc/xdr_stdio.c @@ -61,7 +61,7 @@ static bool_t xdrstdio_getbytes (XDR *, caddr_t, u_int); static bool_t xdrstdio_putbytes (XDR *, const char *, u_int); static u_int xdrstdio_getpos (const XDR *); static bool_t xdrstdio_setpos (XDR *, u_int); -static int32_t *xdrstdio_inline (XDR *, int); +static int32_t *xdrstdio_inline (XDR *, u_int); static void xdrstdio_destroy (XDR *); static bool_t xdrstdio_getint32 (XDR *, int32_t *); static bool_t xdrstdio_putint32 (XDR *, const int32_t *); @@ -114,20 +114,20 @@ xdrstdio_destroy (XDR *xdrs) static bool_t xdrstdio_getlong (XDR *xdrs, long *lp) { - int32_t mycopy; + u_int32_t mycopy; - if (fread ((caddr_t) & mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) + if (fread ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE; - *lp = (int32_t) ntohl (mycopy); + *lp = (long) ntohl (mycopy); return TRUE; } static bool_t xdrstdio_putlong (XDR *xdrs, const long *lp) { - long mycopy = htonl (*lp); - lp = &mycopy; - if (fwrite ((caddr_t) lp, 4, 1, (FILE *) xdrs->x_private) != 1) + int32_t mycopy = htonl ((u_int32_t) *lp); + + if (fwrite ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE; return TRUE; } @@ -163,7 +163,7 @@ xdrstdio_setpos (XDR *xdrs, u_int pos) } static int32_t * -xdrstdio_inline (XDR *xdrs attribute_unused, int len attribute_unused) +xdrstdio_inline (XDR *xdrs attribute_unused, u_int len attribute_unused) { /* * Must do some work to implement this: must insure |