diff options
| author | dsl <dsl@NetBSD.org> | 2005-03-22 23:55:46 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2005-03-22 23:55:46 +0000 |
| commit | a2a01de9478cae97a23ccfa7dad9ed75238b6bc3 (patch) | |
| tree | c63df58a65b5ec49d042600bcdbef52b00b6c353 /usr.bin/printf/printf.c | |
| parent | b519187821938de9f22bc7db992dbba40e20f142 (diff) | |
Remember to consume input bytes when processing '\0nnn' for %b formats
Diffstat (limited to 'usr.bin/printf/printf.c')
| -rw-r--r-- | usr.bin/printf/printf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 3fbe410b39d..9c34b2513b1 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.30 2004/10/30 19:28:10 christos Exp $ */ +/* $NetBSD: printf.c,v 1.31 2005/03/22 23:55:46 dsl Exp $ */ /* * Copyright (c) 1989, 1993 @@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)printf.c 8.2 (Berkeley) 3/22/95"; #else -__RCSID("$NetBSD: printf.c,v 1.30 2004/10/30 19:28:10 christos Exp $"); +__RCSID("$NetBSD: printf.c,v 1.31 2005/03/22 23:55:46 dsl Exp $"); #endif #endif /* not lint */ @@ -354,7 +354,7 @@ conv_escape_str(char *str, void (*do_putchar)(int)) for (i = 0; i < 3; i++) { if (!isdigit((unsigned char)*str) || *str > '7') break; - octnum = (octnum << 3) | (*str - '0'); + octnum = (octnum << 3) | (*str++ - '0'); } do_putchar(octnum); continue; |
