Browse Source

libdpkg: Use varbuf used member instead of strlen() over the buffer

Guillem Jover 12 years ago
parent
commit
767d782ac8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/dpkg/pkg-format.c

+ 1 - 1
lib/dpkg/pkg-format.c

@@ -350,7 +350,7 @@ pkg_format_show(const struct pkg_format_node *head,
 		}
 
 		if (ok) {
-			size_t len = strlen(fb.buf);
+			size_t len = fb.used;
 			if ((node->width > 0) && (len > node->width))
 				len = node->width;
 			varbuf_add_buf(&vb, fb.buf, len);