Skip to content

Commit d80cb15

Browse files
committed
fix: make make build work
1 parent 81dd657 commit d80cb15

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/dmidecodemodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static PyObject *dmidecode_get_slot(PyObject * self, PyObject * args)
656656

657657
static PyObject *dmidecode_get_section(PyObject *self, PyObject *args)
658658
{
659-
char *section = NULL;
659+
const char *section = NULL;
660660
if (PyUnicode_Check(args)) {
661661
section = PyUnicode_AsUTF8(args);
662662
} else if (PyBytes_Check(args)) {
@@ -834,7 +834,7 @@ static PyObject *dmidecode_get_dev(PyObject * self, PyObject * null)
834834

835835
static PyObject *dmidecode_set_dev(PyObject * self, PyObject * arg)
836836
{
837-
char *f = NULL;
837+
const char *f = NULL;
838838
if(PyUnicode_Check(arg)) {
839839
f = PyUnicode_AsUTF8(arg);
840840
} else if(PyBytes_Check(arg)) {
@@ -881,7 +881,7 @@ static PyObject *dmidecode_set_dev(PyObject * self, PyObject * arg)
881881

882882
static PyObject *dmidecode_set_pythonxmlmap(PyObject * self, PyObject * arg)
883883
{
884-
char *fname = NULL;
884+
const char *fname = NULL;
885885

886886
if (PyUnicode_Check(arg)) {
887887
fname = PyUnicode_AsUTF8(arg);
@@ -1044,7 +1044,7 @@ initdmidecodemod(void)
10441044
options *opt;
10451045

10461046
xmlInitParser();
1047-
xmlXPathInit();
1047+
/* xmlXPathInit() is deprecated (no longer needed with libxml2 init) */
10481048

10491049
opt = (options *) malloc(sizeof(options)+2);
10501050
if (opt == NULL)

src/dmidump.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ static int legacy_decode(u8 *buf, const char *devmem, u32 flags, const char *du
152152
devmem, flags, dumpfile);
153153

154154
memcpy(crafted, buf, 16);
155-
overwrite_smbios3_address(crafted);
155+
/* Legacy entry point is a DMI entry point, not SMBIOS3 */
156+
overwrite_dmi_address(crafted);
156157
write_dump(0, 0x0F, crafted, dumpfile, 1);
157158

158159
return 1;

src/dmixml.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,15 @@ static void dmixml_sanitize_xml_string(xmlChar *s)
7777
* @return xmlChar* Pointer to the buffer of the string
7878
*/
7979
xmlChar *dmixml_buildstr(size_t len, const char *fmt, va_list ap) {
80-
xmlChar *ret = NULL, *xmlfmt = NULL;
80+
xmlChar *ret = NULL;
8181
xmlChar *ptr = NULL;
8282

8383
ret = (xmlChar *) malloc(len+2);
8484
assert( ret != NULL );
8585
memset(ret, 0, len+2);
8686

87-
xmlfmt = xmlCharStrdup(fmt);
88-
assert( xmlfmt != NULL );
89-
90-
xmlStrVPrintf(ret, len, xmlfmt, ap);
91-
free(xmlfmt);
87+
/* xmlStrVPrintf expects a const char * format string */
88+
xmlStrVPrintf(ret, len, (const char *)fmt, ap);
9289

9390
dmixml_sanitize_xml_string(ret);
9491

0 commit comments

Comments
 (0)