pypxlib
pypxlib copied to clipboard
Compile error: ‘res’ undeclared (first use in this function)
Hi, I'm unable to compile the library. I'm getting a compile error when using cmake.
.../pxlib/src/paradox.c:3870:25: error: ‘res’ undeclared (first use in this function)
3870 | if(0 > (res = iconv(pxdoc->in_iconvcd, &iptr, &ilen, &optr, &olen))) {
I was able to fix it by declaring int res in that block.
index 7f124bc..91478b7 100644
--- i/src/paradox.c
+++ w/src/paradox.c
@@ -3858,6 +3858,7 @@ PX_put_data_alpha(pxdoc_t *pxdoc, char *data, int len, char *value) {
#if PX_USE_ICONV
size_t ilen = strlen(value);
char *iptr, *optr;
+ int res;
olen = len + 1;
/* Do not pxdoc->malloc because the memory is freed with free
* We use free because the memory allocated by recode_buffer_to_buffer()