Changed sscanf in urldecode to use more portable scan-spec.
[pazpar2-moved-to-github.git] / src / connection.c
index 9ea3275..c330155 100644 (file)
@@ -21,6 +21,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     \brief Z39.50 connection (low-level client)
 */
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -45,10 +49,6 @@ typedef int socklen_t;
 #include <ctype.h>
 #include <assert.h>
 
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <yaz/log.h>
 #include <yaz/comstack.h>
 #include <yaz/tcpip.h>
@@ -183,7 +183,7 @@ static void connection_handler(IOCHAN i, int event)
        int errcode;
         socklen_t errlen = sizeof(errcode);
 
-       if (getsockopt(cs_fileno(co->link), SOL_SOCKET, SO_ERROR, &errcode,
+       if (getsockopt(cs_fileno(co->link), SOL_SOCKET, SO_ERROR, (char*) &errcode,
            &errlen) < 0 || errcode != 0)
        {
             client_fatal(cl);