Mercurial > pidgin
comparison src/conversation.c @ 79:bfdc427b936d
[gaim-migrate @ 89]
I'll save time and just post the email :-)
Summary of changes:
* Misc malloc/free cleanups, use g_malloc more places and
other small stuff (e.g. lineardata not being freed in the
error case in sound.c)
* Misc signed/unsigned cleanups (use size_t more often)
* read() can return -1 at any point, check return values
more rigorously (read_rv variables used for this)
* In can_play_audio, stat requires a pointer to an
allocated stat_buf (the address of an automatic variable)
* escape_text needs a buffer at least 4 times the size of
the text being passed in (not 2 times); I can force core
dumps with lots of newlines otherwise
* There's a debug statement in netscape_command
(browser.c) that was printf("Hello%d\n"); with no int for
the %d; I threw in a getppid(), but the statement should
probably come out eventually.
Thanks, G Sumner Hayes!
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Wed, 05 Apr 2000 05:34:08 +0000 |
parents | dead1eb6d654 |
children | 7a24bb75a97b |
comparison
equal
deleted
inserted
replaced
78:66c5a24b62ec | 79:bfdc427b936d |
---|---|
323 } | 323 } |
324 | 324 |
325 | 325 |
326 static void send_callback(GtkWidget *widget, struct conversation *c) | 326 static void send_callback(GtkWidget *widget, struct conversation *c) |
327 { | 327 { |
328 char buf[BUF_LONG]; | 328 char buf[BUF_LEN*4]; |
329 char *buf2; | 329 char *buf2; |
330 char *buf3; | |
331 gchar *buf4; | 330 gchar *buf4; |
332 int hdrlen; | 331 int hdrlen; |
333 | 332 |
334 buf4 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1); | 333 buf4 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1); |
335 g_snprintf(buf, BUF_LONG, "%s", buf4); | 334 g_snprintf(buf, BUF_LONG, "%s", buf4); |
347 * toc_send_im is 11 chars long + 2 quotes. | 346 * toc_send_im is 11 chars long + 2 quotes. |
348 * + 2 spaces + 6 for the header + 2 for good | 347 * + 2 spaces + 6 for the header + 2 for good |
349 * measure = 23 bytes + the length of normalize c->name */ | 348 * measure = 23 bytes + the length of normalize c->name */ |
350 | 349 |
351 buf2 = g_malloc(BUF_LONG); | 350 buf2 = g_malloc(BUF_LONG); |
352 buf3 = g_malloc(BUF_LONG); | |
353 | 351 |
354 hdrlen = 23 + strlen(normalize(c->name)); | 352 hdrlen = 23 + strlen(normalize(c->name)); |
355 | 353 |
356 /* printf("%d %d %d\n", strlen(buf), hdrlen, BUF_LONG);*/ | 354 /* printf("%d %d %d\n", strlen(buf), hdrlen, BUF_LONG);*/ |
357 | 355 |
402 | 400 |
403 | 401 |
404 gtk_widget_grab_focus(c->entry); | 402 gtk_widget_grab_focus(c->entry); |
405 | 403 |
406 g_free(buf2); | 404 g_free(buf2); |
407 g_free(buf3); | |
408 | 405 |
409 } | 406 } |
410 | 407 |
411 static int | 408 static int |
412 entry_key_pressed(GtkWidget *w, GtkWidget *entry) | 409 entry_key_pressed(GtkWidget *w, GtkWidget *entry) |