]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/names-net.c
lspci: Add support for CXL MLD DVSEC
[pciutils.git] / lib / names-net.c
index 16010300efd52b74c531f35abaf1769dcacd8510..95a6fd2654cd26cb378efad050b8fbd225bc1e07 100644 (file)
@@ -8,12 +8,21 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 #include "internal.h"
 #include "names.h"
 
 #ifdef PCI_USE_DNS
 
+/*
+ * Our definition of BYTE_ORDER confuses arpa/nameser_compat.h on
+ * Solaris so we must undef it before including arpa/nameser.h.
+ */
+#ifdef PCI_OS_SUNOS
+#undef BYTE_ORDER
+#endif
+
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
@@ -187,7 +196,7 @@ char
     default:
       return NULL;
     }
-  sprintf(dnsname, "%s.%s", name, domain);
+  sprintf(dnsname, "%.100s.%.100s", name, domain);
 
   a->debug("Resolving %s\n", dnsname);
   if (!resolver_inited)