]> mj.ucw.cz Git - pciutils.git/commit
Truncate names which are too long
authorMartin Mares <mj@ucw.cz>
Sun, 2 Oct 2011 10:41:07 +0000 (12:41 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 2 Oct 2011 10:41:07 +0000 (12:41 +0200)
commite616394f2082948b8aba0a75cf40e7f50d2fc9ab
tree22a254fd8396837afab104235578893387ae6686
parent9b50f808d1ff9bab21a1c8f68fe8c119393ac75b
Truncate names which are too long

When any name turned out too long, we returned "<pci_lookup_name: buffer too small>",
which wasn't very useful. Instead of that, we truncate the name and
we add "..." at the end.

Please note that for simplicity, the truncation happens only on systems with proper
C99 snprintf(). Ancient systems where snprintf() returns a negative number and
promises nothing about the state of the buffer still use the error message.
lib/names.c