Module Name:    src
Committed By:   pgoyette
Date:           Wed Aug  7 22:37:28 UTC 2013

Modified Files:
        src/common/lib/libutil: snprintb.c

Log Message:
Fix boundary condition in multi-line format.  When the '=' following a
field name exactly filled a line, the back-up logic failed and really
messed up the formatting!


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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.9 src/common/lib/libutil/snprintb.c:1.10
--- src/common/lib/libutil/snprintb.c:1.9	Tue Aug  6 22:02:50 2013
+++ src/common/lib/libutil/snprintb.c	Wed Aug  7 22:37:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: snprintb.c,v 1.9 2013/08/06 22:02:50 apb Exp $	*/
+/*	$NetBSD: snprintb.c,v 1.10 2013/08/07 22:37:28 pgoyette 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.9 2013/08/06 22:02:50 apb Exp $");
+__RCSID("$NetBSD: snprintb.c,v 1.10 2013/08/07 22:37:28 pgoyette Exp $");
 #  endif
 
 #  include <sys/types.h>
@@ -51,7 +51,7 @@ __RCSID("$NetBSD: snprintb.c,v 1.9 2013/
 #  include <errno.h>
 # else /* ! _KERNEL */
 #  include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.9 2013/08/06 22:02:50 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.10 2013/08/07 22:37:28 pgoyette Exp $");
 #  include <sys/param.h>
 #  include <sys/inttypes.h>
 #  include <sys/systm.h>
@@ -215,10 +215,10 @@ snprintb_m(char *buf, size_t buflen, con
 					sep = ',';
 				if (ch == 'F')	/* just extract */
 					break;
-				if (restart == 0) {
+				if (restart == 0)
 					PUTS(bitfmt);
+				if (restart == 0)
 					PUTCHR('=');
-				}
 				if (restart == 0) {
 					f_len = snprintf(bp, buflen - t_len,
 							 sbase, field);

Reply via email to