Corrected some format specifiers to account for different size of size_t types on 64 bit systems

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2942 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2009-07-01 12:28:40 +00:00
parent 9f8296a067
commit 2c43bde47c
3 changed files with 5 additions and 5 deletions

View File

@ -320,7 +320,7 @@ public:
{ {
ssize_t nBytes = ::send( mSd, msg.data(), msg.size(), 0 ); ssize_t nBytes = ::send( mSd, msg.data(), msg.size(), 0 );
if ( nBytes < 0 ) if ( nBytes < 0 )
Debug( 1, "Send of string '%s' (%d bytes) on sd %d failed: %s", msg.c_str(), msg.size(), mSd, strerror(errno) ); Debug( 1, "Send of string '%s' (%zd bytes) on sd %d failed: %s", msg.c_str(), msg.size(), mSd, strerror(errno) );
return( nBytes ); return( nBytes );
} }
virtual int recv( std::string &msg ) const virtual int recv( std::string &msg ) const
@ -329,7 +329,7 @@ public:
int nBytes = 0; int nBytes = 0;
if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 ) if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 )
{ {
Debug( 1, "Recv of %d bytes max to string on sd %d failed: %s", sizeof(buffer), mSd, strerror(errno) ); Debug( 1, "Recv of %zd bytes max to string on sd %d failed: %s", sizeof(buffer), mSd, strerror(errno) );
return( nBytes ); return( nBytes );
} }
buffer[nBytes] = '\0'; buffer[nBytes] = '\0';
@ -342,7 +342,7 @@ public:
int nBytes = 0; int nBytes = 0;
if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 ) if ( (nBytes = ::recv( mSd, buffer, sizeof(buffer), 0 )) < 0 )
{ {
Debug( 1, "Recv of %d bytes max to string on sd %d failed: %s", maxLen, mSd, strerror(errno) ); Debug( 1, "Recv of %zd bytes max to string on sd %d failed: %s", maxLen, mSd, strerror(errno) );
return( nBytes ); return( nBytes );
} }
buffer[nBytes] = '\0'; buffer[nBytes] = '\0';

View File

@ -315,7 +315,7 @@ bool Event::SendFrameImage( const Image *image, bool alarm_frame )
} }
else else
{ {
Error( "Incomplete frame write: %d of %d bytes written", writev_result, writev_size ); Error( "Incomplete frame write: %zd of %zd bytes written", writev_result, writev_size );
close( sd ); close( sd );
sd = -1; sd = -1;
} }

View File

@ -87,7 +87,7 @@ RETSIGTYPE zm_die_handler( int signal )
// overwrite sigaction with caller's address // overwrite sigaction with caller's address
trace[1] = (void *)context.eip; trace[1] = (void *)context.eip;
#elif HAVE_STRUCT_SIGCONTEXT #elif HAVE_STRUCT_SIGCONTEXT
Error( "Signal address is %p, no eip", context.cr2 ); Error( "Signal address is %p, no eip", (void *)context.cr2 );
trace_size = backtrace( trace, TRACE_SIZE ); trace_size = backtrace( trace, TRACE_SIZE );
#else // HAVE_STRUCT_SIGCONTEXT #else // HAVE_STRUCT_SIGCONTEXT