Module Name: src
Committed By: ryo
Date: Sat Oct 14 18:41:41 UTC 2017
Modified Files:
src/common/lib/libutil: snprintb.c
Log Message:
doesn't work new format 'F' with a strings of length 1, or a string beginning
with 'F'
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libutil/snprintb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/common/lib/libutil/snprintb.c
diff -u src/common/lib/libutil/snprintb.c:1.16 src/common/lib/libutil/snprintb.c:1.17
--- src/common/lib/libutil/snprintb.c:1.16 Sat Aug 2 11:19:01 2014
+++ src/common/lib/libutil/snprintb.c Sat Oct 14 18:41:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: snprintb.c,v 1.16 2014/08/02 11:19:01 ryo Exp $ */
+/* $NetBSD: snprintb.c,v 1.17 2017/10/14 18:41:41 ryo Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
# include <sys/cdefs.h>
# if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: snprintb.c,v 1.16 2014/08/02 11:19:01 ryo Exp $");
+__RCSID("$NetBSD: snprintb.c,v 1.17 2017/10/14 18:41:41 ryo Exp $");
# endif
# include <sys/types.h>
@@ -51,7 +51,7 @@ __RCSID("$NetBSD: snprintb.c,v 1.16 2014
# include <errno.h>
# else /* ! _KERNEL */
# include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.16 2014/08/02 11:19:01 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.17 2017/10/14 18:41:41 ryo Exp $");
# include <sys/param.h>
# include <sys/inttypes.h>
# include <sys/systm.h>
@@ -215,8 +215,10 @@ snprintb_m(char *buf, size_t buflen, con
PUTSEP;
if (restart == 0)
sep = ',';
- if (ch == 'F') /* just extract */
+ if (ch == 'F') { /* just extract */
+ bitfmt--;
break;
+ }
if (restart == 0)
PUTS(bitfmt);
if (restart == 0)