comparison src/util.c @ 1521:ba83e9e2fd9b

[gaim-migrate @ 1531] fix double-escaping of away messages and fix segfault for away messages that only consist of {}\\\"\n committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 01 Mar 2001 02:29:54 +0000
parents 5c67b8794991
children ba8e6e211af5
comparison
equal deleted inserted replaced
1520:f9f1e3bc1918 1521:ba83e9e2fd9b
516 if (strlen(msg) > BUF_LEN) { 516 if (strlen(msg) > BUF_LEN) {
517 fprintf(stderr, "Warning: truncating message to 2048 bytes\n"); 517 fprintf(stderr, "Warning: truncating message to 2048 bytes\n");
518 msg[2047] = '\0'; 518 msg[2047] = '\0';
519 } 519 }
520 520
521 woo = malloc(strlen(msg) * 2); 521 woo = malloc(strlen(msg) * 4 + 1);
522 cpy = g_strdup(msg); 522 cpy = g_strdup(msg);
523 c = cpy; 523 c = cpy;
524 while (*c) { 524 while (*c) {
525 switch (*c) { 525 switch (*c) {
526 case '\n': 526 case '\n':