Skip to content

Commit fb230ae

Browse files
committed
Use proper type for return value of PyUnicode_AsUTF8()
Fixes #31. Signed-off-by: Nikola Forró <nforro@redhat.com>
1 parent 5a2a6c8 commit fb230ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cec.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ using namespace CEC;
103103
#define HAVE_CEC_ADAPTER_DESCRIPTOR 0
104104
#endif
105105

106-
int parse_physical_addr(char * addr) {
106+
int parse_physical_addr(const char * addr) {
107107
int a, b, c, d;
108108
if( sscanf(addr, "%x.%x.%x.%x", &a, &b, &c, &d) == 4 ) {
109109
if( a > 0xF || b > 0xF || c > 0xF || d > 0xF ) return -1;
@@ -527,7 +527,7 @@ static PyObject * set_stream_path(PyObject * self, PyObject * args) {
527527
}
528528
#if PY_MAJOR_VERSION >= 3
529529
} else if(PyUnicode_Check(arg)) {
530-
char * arg_s = PyUnicode_AsUTF8(arg);
530+
const char * arg_s = PyUnicode_AsUTF8(arg);
531531
#else
532532
} else if(PyString_Check(arg)) {
533533
char * arg_s = PyString_AsString(arg);

0 commit comments

Comments
 (0)