Mercurial > pidgin
comparison src/server.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 | 939455223459 |
| children | 9f6ce50ffb78 |
comparison
equal
deleted
inserted
replaced
| 78:66c5a24b62ec | 79:bfdc427b936d |
|---|---|
| 106 void serv_finish_login() | 106 void serv_finish_login() |
| 107 { | 107 { |
| 108 char *buf; | 108 char *buf; |
| 109 | 109 |
| 110 if (strlen(current_user->user_info)) { | 110 if (strlen(current_user->user_info)) { |
| 111 buf = g_malloc(strlen(current_user->user_info) * 2); | 111 buf = g_malloc(strlen(current_user->user_info) * 4); |
| 112 strcpy(buf, current_user->user_info); | 112 strcpy(buf, current_user->user_info); |
| 113 escape_text(buf); | 113 escape_text(buf); |
| 114 serv_set_info(buf); | 114 serv_set_info(buf); |
| 115 g_free(buf); | 115 g_free(buf); |
| 116 } | 116 } |
| 168 | 168 |
| 169 void serv_set_dir(char *first, char *middle, char *last, char *maiden, | 169 void serv_set_dir(char *first, char *middle, char *last, char *maiden, |
| 170 char *city, char *state, char *country, int web) | 170 char *city, char *state, char *country, int web) |
| 171 { | 171 { |
| 172 #ifndef USE_OSCAR | 172 #ifndef USE_OSCAR |
| 173 char buf2[BUF_LEN], buf[BUF_LEN]; | 173 char buf2[BUF_LEN*4], buf[BUF_LEN]; |
| 174 g_snprintf(buf2, sizeof(buf2), "%s:%s:%s:%s:%s:%s:%s:%s", first, | 174 g_snprintf(buf2, sizeof(buf2), "%s:%s:%s:%s:%s:%s:%s:%s", first, |
| 175 middle, last, maiden, city, state, country, | 175 middle, last, maiden, city, state, country, |
| 176 (web == 1) ? "Y" : ""); | 176 (web == 1) ? "Y" : ""); |
| 177 escape_text(buf2); | 177 escape_text(buf2); |
| 178 g_snprintf(buf, sizeof(buf), "toc_set_dir %s", buf2); | 178 g_snprintf(buf, sizeof(buf), "toc_set_dir %s", buf2); |
| 575 if (find_log_info(name) || (general_options & OPT_GEN_LOG_ALL)) | 575 if (find_log_info(name) || (general_options & OPT_GEN_LOG_ALL)) |
| 576 g_snprintf(who, 63, LOG_CONVERSATION_TITLE, name); | 576 g_snprintf(who, 63, LOG_CONVERSATION_TITLE, name); |
| 577 else | 577 else |
| 578 g_snprintf(who, 63, CONVERSATION_TITLE, name); | 578 g_snprintf(who, 63, CONVERSATION_TITLE, name); |
| 579 gtk_window_set_title(GTK_WINDOW(cv->window), who); | 579 gtk_window_set_title(GTK_WINDOW(cv->window), who); |
| 580 /* no free 'who', set_title needs it. | 580 /* was g_free(buf), but break gives us that |
| 581 */ | 581 * and freeing twice is not good --Sumner */ |
| 582 /* Umm .. Why?? */ | |
| 583 g_free(who); | |
| 584 break; | 582 break; |
| 585 } | 583 } |
| 586 cnv = cnv->next; | 584 cnv = cnv->next; |
| 587 } | 585 } |
| 588 g_free(who); | 586 g_free(who); |
