diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c index d8ad60d479b1..aa19fdfa64a5 100644 --- a/lib/libc/gen/vis.c +++ b/lib/libc/gen/vis.c @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.13 1999/09/20 04:39:07 lukem Exp $ */ +/* $NetBSD: vis.c,v 1.14 1999/11/17 15:52:13 wennmach Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)vis.c 8.1 (Berkeley) 7/19/93"; #else -__RCSID("$NetBSD: vis.c,v 1.13 1999/09/20 04:39:07 lukem Exp $"); +__RCSID("$NetBSD: vis.c,v 1.14 1999/11/17 15:52:13 wennmach Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -133,8 +133,8 @@ vis(dst, c, flag, nextc) } if (((c & 0177) == ' ') || (flag & VIS_OCTAL)) { *dst++ = '\\'; - *dst++ = ((((u_int32_t)c) >> 6) & 07) + '0'; - *dst++ = ((((u_int32_t)c) >> 3) & 07) + '0'; + *dst++ = (u_char)((((u_int32_t)(u_char)c) >> 6) & 03) + '0'; + *dst++ = (u_char)((((u_int32_t)(u_char)c) >> 3) & 07) + '0'; *dst++ = (((u_char)c) & 07) + '0'; goto done; }