aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-04-15 14:59:52 -0700
committerWilmer van der Gaast <wilmer@gaast.net>2007-04-15 14:59:52 -0700
commitcd4723c257f9f7bd8d4a46c6562f93c2aefc3dbb (patch)
tree409bbd6422dff0c22257e6106220ab42969c9a97
parent552e641194147078c7858059df9916d5d548b7a1 (diff)
More format string problems.
-rw-r--r--protocols/jabber/iq.c2
-rw-r--r--protocols/oscar/oscar.c28
-rw-r--r--protocols/yahoo/yahoo.c18
3 files changed, 10 insertions, 38 deletions
diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c
index e1848272..86dca30a 100644
--- a/protocols/jabber/iq.c
+++ b/protocols/jabber/iq.c
@@ -535,7 +535,7 @@ static xt_status jabber_iq_display_vcard( struct im_connection *ic, struct xt_no
/* *sigh* */
- imc_log( ic, reply->str );
+ imc_log( ic, "%s", reply->str );
g_string_free( reply, TRUE );
return XT_HANDLED;
diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c
index 929b63d3..abc2f4be 100644
--- a/protocols/oscar/oscar.c
+++ b/protocols/oscar/oscar.c
@@ -1263,7 +1263,6 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
va_list ap;
guint16 chan, nummissed, reason;
aim_userinfo_t *userinfo;
- char buf[1024];
va_start(ap, fr);
chan = (guint16)va_arg(ap, unsigned int);
@@ -1275,8 +1274,7 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
switch(reason) {
case 0:
/* Invalid (0) */
- g_snprintf(buf,
- sizeof(buf),
+ imc_error(sess->aux_data,
nummissed == 1 ?
_("You missed %d message from %s because it was invalid.") :
_("You missed %d messages from %s because they were invalid."),
@@ -1285,8 +1283,7 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
break;
case 1:
/* Message too large */
- g_snprintf(buf,
- sizeof(buf),
+ imc_error(sess->aux_data,
nummissed == 1 ?
_("You missed %d message from %s because it was too large.") :
_("You missed %d messages from %s because they were too large."),
@@ -1295,8 +1292,7 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
break;
case 2:
/* Rate exceeded */
- g_snprintf(buf,
- sizeof(buf),
+ imc_error(sess->aux_data,
nummissed == 1 ?
_("You missed %d message from %s because the rate limit has been exceeded.") :
_("You missed %d messages from %s because the rate limit has been exceeded."),
@@ -1305,8 +1301,7 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
break;
case 3:
/* Evil Sender */
- g_snprintf(buf,
- sizeof(buf),
+ imc_error(sess->aux_data,
nummissed == 1 ?
_("You missed %d message from %s because it was too evil.") :
_("You missed %d messages from %s because they are too evil."),
@@ -1315,8 +1310,7 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
break;
case 4:
/* Evil Receiver */
- g_snprintf(buf,
- sizeof(buf),
+ imc_error(sess->aux_data,
nummissed == 1 ?
_("You missed %d message from %s because you are too evil.") :
_("You missed %d messages from %s because you are too evil."),
@@ -1324,8 +1318,7 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
userinfo->sn);
break;
default:
- g_snprintf(buf,
- sizeof(buf),
+ imc_error(sess->aux_data,
nummissed == 1 ?
_("You missed %d message from %s for unknown reasons.") :
_("You missed %d messages from %s for unknown reasons."),
@@ -1333,7 +1326,6 @@ static int gaim_parse_misses(aim_session_t *sess, aim_frame_t *fr, ...) {
userinfo->sn);
break;
}
- imc_error(sess->aux_data, buf);
return 1;
}
@@ -1925,13 +1917,7 @@ static void oscar_set_away_aim(struct im_connection *ic, struct oscar_data *od,
}
if (strlen(message) > od->rights.maxawaymsglen) {
- gchar *errstr;
-
- errstr = g_strdup_printf("Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen);
-
- imc_error(ic, errstr);
-
- g_free(errstr);
+ imc_error(ic, "Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen);
}
ic->away = g_strndup(message, od->rights.maxawaymsglen);
diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c
index 424a0ad1..c10c3103 100644
--- a/protocols/yahoo/yahoo.c
+++ b/protocols/yahoo/yahoo.c
@@ -517,7 +517,6 @@ void ext_yahoo_login_response( int id, int succ, char *url )
else
{
char *errstr;
- char *s;
yd->logged_in = FALSE;
@@ -538,22 +537,9 @@ void ext_yahoo_login_response( int id, int succ, char *url )
errstr = "Unknown error";
if( url && *url )
- {
- s = g_malloc( strlen( "Error %d (%s). See %s for more information." ) + strlen( url ) + strlen( errstr ) + 16 );
- sprintf( s, "Error %d (%s). See %s for more information.", succ, errstr, url );
- }
+ imc_error( ic, "Error %d (%s). See %s for more information.", succ, errstr, url );
else
- {
- s = g_malloc( strlen( "Error %d (%s)" ) + strlen( errstr ) + 16 );
- sprintf( s, "Error %d (%s)", succ, errstr );
- }
-
- if( yd->logged_in )
- imc_error( ic, s );
- else
- imc_error( ic, s );
-
- g_free( s );
+ imc_error( ic, "Error %d (%s)", succ, errstr );
imc_logout( ic );
}