Skip to content

Commit

Permalink
Use proper type for return value of PyUnicode_AsUTF8()
Browse files Browse the repository at this point in the history
Fixes #31.

Signed-off-by: Nikola Forró <[email protected]>
  • Loading branch information
nforro committed Oct 24, 2018
1 parent 5a2a6c8 commit fb230ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ using namespace CEC;
#define HAVE_CEC_ADAPTER_DESCRIPTOR 0
#endif

int parse_physical_addr(char * addr) {
int parse_physical_addr(const char * addr) {
int a, b, c, d;
if( sscanf(addr, "%x.%x.%x.%x", &a, &b, &c, &d) == 4 ) {
if( a > 0xF || b > 0xF || c > 0xF || d > 0xF ) return -1;
Expand Down Expand Up @@ -527,7 +527,7 @@ static PyObject * set_stream_path(PyObject * self, PyObject * args) {
}
#if PY_MAJOR_VERSION >= 3
} else if(PyUnicode_Check(arg)) {
char * arg_s = PyUnicode_AsUTF8(arg);
const char * arg_s = PyUnicode_AsUTF8(arg);
#else
} else if(PyString_Check(arg)) {
char * arg_s = PyString_AsString(arg);
Expand Down

0 comments on commit fb230ae

Please sign in to comment.