From 736efca5ddb22d28333e5094f206b44bb3041e19 Mon Sep 17 00:00:00 2001 From: "Nektarios K. Papadopoulos" Date: Wed, 26 Jul 2006 13:48:36 +0000 Subject: [PATCH] Fix issue reported by Siva Chandran P strlen returns size_t which is long or int depending on the platform. We use %ld in printf and cast the return value to long. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@71 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- upnp/src/gena/gena_device.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c index 36cdefc..8c74483 100644 --- a/upnp/src/gena/gena_device.c +++ b/upnp/src/gena/gena_device.c @@ -756,8 +756,8 @@ genaInitNotifyExt( IN UpnpDevice_Handle device_handle, } sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: " - "%d\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n", - strlen( propertySet ) + 1 ); + "%ld\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n", + (long) strlen( propertySet ) + 1 ); //schedule thread for initial notification @@ -893,8 +893,8 @@ genaNotifyAllExt( IN UpnpDevice_Handle device_handle, //changed to add null terminator at end of content //content length = (length in bytes of property set) + null char sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: " - "%d\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n", - strlen( propertySet ) + 1 ); + "%ld\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n", + (long) strlen( propertySet ) + 1 ); HandleLock( ); @@ -1054,9 +1054,9 @@ genaNotifyAll( IN UpnpDevice_Handle device_handle, } //changed to add null terminator at end of content //content length = (length in bytes of property set) + null char - sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: %d\r\nNT:" + sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: %ld\r\nNT:" " upnp:event\r\nNTS: upnp:propchange\r\n", - strlen( propertySet ) + 1 ); + (long) strlen( propertySet ) + 1 ); HandleLock( );