/pidgin/main: a92df44dceb3: Start converting sprintf() calls to ...

Andrew Victor andrew.victor at mxit.com
Wed Mar 6 17:24:30 EST 2013


Changeset: a92df44dceb381ad830a81ae2ae5109c00b90dc7
Author:	 Andrew Victor <andrew.victor at mxit.com>
Date:	 2013-03-06 23:45 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/a92df44dceb3

Description:

Start converting sprintf() calls to snprintf().

diffstat:

 libpurple/protocols/mxit/protocol.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (57 lines):

diff --git a/libpurple/protocols/mxit/protocol.c b/libpurple/protocols/mxit/protocol.c
--- a/libpurple/protocols/mxit/protocol.c
+++ b/libpurple/protocols/mxit/protocol.c
@@ -1244,7 +1244,7 @@ void mxit_send_file( struct MXitSession*
 	purple_debug_info( MXIT_PLUGIN_ID, "SENDING FILE '%s' of %i bytes to user '%s'\n", filename, buflen, username );
 
 	/* convert the packet to a byte stream */
-	datalen = sprintf( data, "ms=" );
+	datalen = snprintf( data, sizeof( data ), "ms=" );
 
 	/* map chunk header over data buffer */
 	chunk = &data[datalen];
@@ -1280,7 +1280,7 @@ void mxit_send_file_reject( struct MXitS
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_send_file_reject\n" );
 
 	/* convert the packet to a byte stream */
-	datalen = sprintf( data, "ms=" );
+	datalen = snprintf( data, sizeof( data ), "ms=" );
 
 	/* map chunk header over data buffer */
 	chunk = &data[datalen];
@@ -1318,7 +1318,7 @@ void mxit_send_file_accept( struct MXitS
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_send_file_accept\n" );
 
 	/* convert the packet to a byte stream */
-	datalen = sprintf( data, "ms=" );
+	datalen = snprintf( data, sizeof( data ), "ms=" );
 
 	/* map chunk header over data buffer */
 	chunk = &data[datalen];
@@ -1354,7 +1354,7 @@ void mxit_send_file_received( struct MXi
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_send_file_received\n" );
 
 	/* convert the packet to a byte stream */
-	datalen = sprintf( data, "ms=" );
+	datalen = snprintf( data, sizeof( data ), "ms=" );
 
 	/* map chunk header over data buffer */
 	chunk = &data[datalen];
@@ -1391,7 +1391,7 @@ void mxit_set_avatar( struct MXitSession
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_set_avatar: %i bytes\n", avatarlen );
 
 	/* convert the packet to a byte stream */
-	datalen = sprintf( data, "ms=" );
+	datalen = snprintf( data, sizeof( data ), "ms=" );
 
 	/* map chunk header over data buffer */
 	chunk = &data[datalen];
@@ -1430,7 +1430,7 @@ void mxit_get_avatar( struct MXitSession
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_get_avatar: %s\n", mxitId );
 
 	/* convert the packet to a byte stream */
-	datalen = sprintf( data, "ms=" );
+	datalen = snprintf( data, sizeof( data ), "ms=" );
 
 	/* map chunk header over data buffer */
 	chunk = &data[datalen];



More information about the Commits mailing list