Changes in / [70e68cf:5014380]


Ignore:
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.h

    r70e68cf r5014380  
    9393#undef g_source_remove
    9494#define g_source_remove         __PLEASE_USE_B_EVENT_REMOVE__
    95 #undef g_source_remove_by_user_data
    96 #define g_source_remove_by_user_data    __PLEASE_USE_B_SOURCE_REMOVE_BY_USER_DATA__
    9795#undef g_main_run
    9896#define g_main_run              __PLEASE_USE_B_MAIN_RUN__
  • irc_im.c

    r70e68cf r5014380  
    5050
    5151        memset(nick, 0, MAX_NICK_LENGTH + 1);
    52         strcpy(nick, nick_get(bu));
     52        strncpy(nick, nick_get(bu), MAX_NICK_LENGTH);
    5353
    5454        bu->ui_data = iu = irc_user_new(irc, nick);
     
    723723                        g_free(channel);
    724724                        channel = s;
     725                } else {
     726                        g_free(s);
    725727                }
    726728        }
  • irc_send.c

    r70e68cf r5014380  
    175175
    176176        if (iu == irc->user) {
    177                 irc_write(irc, ":%s MODE %s +%s", irc->root->host, ic->name, ic->mode);
    178                 irc_send_names(ic);
    179177                if (ic->topic && *ic->topic) {
    180178                        irc_send_topic(ic, FALSE);
    181179                }
     180                irc_send_names(ic);
    182181        }
    183182}
  • lib/events_glib.c

    r70e68cf r5014380  
    8282        }
    8383
    84         event_debug("gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data);
     84        event_debug("gaim_io_invoke( %d, %d, %p )\n", g_io_channel_unix_get_fd(source), condition, data);
    8585
    8686        st = closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond);
     
    101101static void gaim_io_destroy(gpointer data)
    102102{
    103         event_debug("gaim_io_destroy( 0x%x )\n", data);
     103        event_debug("gaim_io_destroy( 0%p )\n", data);
    104104        g_free(data);
    105105}
     
    127127                                 gaim_io_invoke, closure, gaim_io_destroy);
    128128
    129         event_debug("b_input_add( %d, %d, 0x%x, 0x%x ) = %d (%p)\n", source, condition, function, data, st, closure);
     129        event_debug("b_input_add( %d, %d, %p, %p ) = %d (%p)\n", source, condition, function, data, st, closure);
    130130
    131131        g_io_channel_unref(channel);
     
    140140        gint st = g_timeout_add(timeout, (GSourceFunc) func, data);
    141141
    142         event_debug("b_timeout_add( %d, %d, %d ) = %d\n", timeout, func, data, st);
     142        event_debug("b_timeout_add( %d, %p, %p ) = %d\n", timeout, func, data, st);
    143143
    144144        return st;
  • lib/oauth2.c

    r70e68cf r5014380  
    140140        struct oauth2_access_token_data *cb_data = req->data;
    141141        char *atoken = NULL, *rtoken = NULL, *error = NULL;
    142         char *content_type;
     142        char *content_type = NULL;
    143143
    144         if (getenv("BITLBEE_DEBUG") && req->reply_body) {
     144        if (req->status_code <= 0 && !req->reply_body) {
     145                cb_data->func(cb_data->data, NULL, NULL, req->status_string);
     146                g_free(cb_data);
     147                return;
     148        }
     149
     150        if (getenv("BITLBEE_DEBUG")) {
    145151                printf("%s\n", req->reply_body);
    146152        }
  • protocols/jabber/jabber.c

    r70e68cf r5014380  
    428428        }
    429429
    430         jabber_get_vcard(ic, bud ? bud->full_jid : who);
     430        jabber_get_vcard(ic, who);
    431431}
    432432
  • protocols/msn/gw.c

    r70e68cf r5014380  
    8787        gw->polling = FALSE;
    8888
     89        if (req->status_code != 200 || !req->reply_body) {
     90                gw->callback(gw->md, -1, B_EV_IO_READ);
     91                return;
     92        }
     93
    8994        if (getenv("BITLBEE_DEBUG")) {
    9095                fprintf(stderr, "\n\x1b[90mHTTP:%s\n", req->reply_body);
    9196                fprintf(stderr, "\n\x1b[97m\n");
    92         }
    93 
    94         if (req->status_code != 200) {
    95                 gw->callback(gw->md, -1, B_EV_IO_READ);
    96                 return;
    9797        }
    9898
     
    113113        if (req->body_size) {
    114114                g_byte_array_append(gw->in, (const guint8 *) req->reply_body, req->body_size);
    115                 gw->callback(gw->md, -1, B_EV_IO_READ);
     115
     116                if (!gw->callback(gw->md, -1, B_EV_IO_READ)) {
     117                        return;
     118                }
    116119        }
    117120
  • protocols/msn/ns.c

    r70e68cf r5014380  
    181181                imcb_error(ic, "Error while reading from server");
    182182                imc_logout(ic, TRUE);
     183                g_free(bytes);
    183184                return FALSE;
    184185        }
     
    188189        g_free(bytes);
    189190
    190         /* Ignore ret == 0, it's already disconnected then. */
    191         msn_handler(md);
    192 
    193         return TRUE;
    194        
     191        return msn_handler(md);
    195192}
    196193
  • protocols/oscar/ssi.c

    r70e68cf r5014380  
    6666                                newitem->gid += 0x0001;
    6767                                for (cur = *list, i = 0; ((cur) && (!i)); cur = cur->next) {
    68                                         if ((cur->gid == newitem->gid) && (cur->gid == newitem->gid)) {
     68                                        if ((cur->bid == newitem->bid) && (cur->gid == newitem->gid)) {
    6969                                                i = 1;
    7070                                        }
  • protocols/twitter/twitter.c

    r70e68cf r5014380  
    483483}
    484484
    485 static gboolean twitter_length_check(struct im_connection *ic, gchar * msg)
    486 {
    487         int max = set_getint(&ic->acc->set, "message_length"), len;
    488         int target_len = set_getint(&ic->acc->set, "target_url_length");
     485int twitter_message_len(gchar *msg, int target_len)
     486{
    489487        int url_len_diff = 0;
    490488
     
    493491        }
    494492
    495         if (max == 0 || (len = g_utf8_strlen(msg, -1) + url_len_diff) <= max) {
     493        return g_utf8_strlen(msg, -1) + url_len_diff;
     494}
     495
     496static gboolean twitter_length_check(struct im_connection *ic, gchar * msg)
     497{
     498        int max = set_getint(&ic->acc->set, "message_length");
     499        int target_len = set_getint(&ic->acc->set, "target_url_length");
     500        int len = twitter_message_len(msg, target_len);
     501
     502        if (max == 0 || len <= max) {
    496503                return TRUE;
    497504        }
  • protocols/yahoo/yahoo2.h

    r70e68cf r5014380  
    3333#undef malloc
    3434#define malloc(x)             g_malloc(x)
    35 #undef calloc
    36 #define calloc(x, y)          g_calloc(x, y)
    3735#undef realloc
    3836#define realloc(x, y)         g_realloc(x, y)
  • unix.c

    r70e68cf r5014380  
    212212                       argv[0], argv[0], argv[0], argv[0], argv[0]);
    213213        } else if (strcmp(argv[2], "enc") == 0) {
    214                 pass_len = arc_encode(argv[4], strlen(argv[4]), (unsigned char **) &pass_cr, argv[3], 12);
    215                 printf("%s\n", base64_encode(pass_cr, pass_len));
     214                char *encoded;
     215
     216                pass_len = arc_encode(argv[4], strlen(argv[4]), &pass_cr, argv[3], 12);
     217
     218                encoded = base64_encode(pass_cr, pass_len);
     219                printf("%s\n", encoded);
     220                g_free(encoded);
     221                g_free(pass_cr);
    216222        } else if (strcmp(argv[2], "dec") == 0) {
    217                 pass_len = base64_decode(argv[4], (unsigned char **) &pass_cr);
     223                pass_len = base64_decode(argv[4], &pass_cr);
    218224                arc_decode(pass_cr, pass_len, (char **) &pass_cl, argv[3]);
    219225                printf("%s\n", pass_cl);
     226
     227                g_free(pass_cr);
     228                g_free(pass_cl);
    220229        } else if (strcmp(argv[2], "hash") == 0) {
    221230                md5_byte_t pass_md5[21];
    222231                md5_state_t md5_state;
     232                char *encoded;
    223233
    224234                random_bytes(pass_md5 + 16, 5);
     
    228238                md5_finish(&md5_state, pass_md5);
    229239
    230                 printf("%s\n", base64_encode(pass_md5, 21));
     240                encoded = base64_encode(pass_md5, 21);
     241                printf("%s\n", encoded);
     242                g_free(encoded);
    231243        } else if (strcmp(argv[2], "unhash") == 0) {
    232244                printf("Hash %s submitted to a massive Beowulf cluster of\n"
Note: See TracChangeset for help on using the changeset viewer.