]> git.ipfire.org Git - thirdparty/pciutils.git/blobdiff - ls-tree.c
lspci: Fix handling of truncated lines for msvcrt.dll
[thirdparty/pciutils.git] / ls-tree.c
index e845f662d71c46924d2fc8fe5a5166cfb78ec2b5..cc65ac472097b36d93100e7ba6821ebf873fecfd 100644 (file)
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -239,7 +239,11 @@ tree_printf(char *line, char *p, char *fmt, ...)
       p += space;
     }
   else if (res >= space)
-    p += space;
+    {
+      /* Ancient C libraries do not truncate the output properly. */
+      *(p+space-1) = 0;
+      p += space;
+    }
   else
     p += res;