comparison src/util.c @ 254:fa67d29b53d5

[gaim-migrate @ 264] Things don't need to be escaped for Oscar. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 23 May 2000 05:54:31 +0000
parents ec0686b3b03f
children 29e1669b006b
comparison
equal deleted inserted replaced
253:5b28ef2b550e 254:fa67d29b53d5
398 g_free(buf2); 398 g_free(buf2);
399 return fd; 399 return fd;
400 } 400 }
401 401
402 402
403 /* we only need this for TOC, because messages must be escaped */
403 int escape_message(char *msg) 404 int escape_message(char *msg)
404 { 405 {
406 #ifndef USE_OSCAR
405 char *c, *cpy; 407 char *c, *cpy;
406 int cnt=0; 408 int cnt=0;
407 /* Assumes you have a buffer able to cary at least BUF_LEN * 2 bytes */ 409 /* Assumes you have a buffer able to cary at least BUF_LEN * 2 bytes */
408 if (strlen(msg) > BUF_LEN) { 410 if (strlen(msg) > BUF_LEN) {
409 sprintf(debug_buff, "Warning: truncating message to 2048 bytes\n"); 411 sprintf(debug_buff, "Warning: truncating message to 2048 bytes\n");
429 c++; 431 c++;
430 } 432 }
431 msg[cnt]='\0'; 433 msg[cnt]='\0';
432 g_free(cpy); 434 g_free(cpy);
433 return cnt; 435 return cnt;
434 } 436 #else
435 437 return strlen(msg);
438 #endif
439 }
440
441 /* we don't need this for oscar either */
436 int escape_text(char *msg) 442 int escape_text(char *msg)
437 { 443 {
444 #ifndef USE_OSCAR
438 char *c, *cpy; 445 char *c, *cpy;
439 int cnt=0; 446 int cnt=0;
440 /* Assumes you have a buffer able to cary at least BUF_LEN * 4 bytes */ 447 /* Assumes you have a buffer able to cary at least BUF_LEN * 4 bytes */
441 if (strlen(msg) > BUF_LEN) { 448 if (strlen(msg) > BUF_LEN) {
442 fprintf(stderr, "Warning: truncating message to 2048 bytes\n"); 449 fprintf(stderr, "Warning: truncating message to 2048 bytes\n");
465 c++; 472 c++;
466 } 473 }
467 msg[cnt]='\0'; 474 msg[cnt]='\0';
468 g_free(cpy); 475 g_free(cpy);
469 return cnt; 476 return cnt;
477 #else
478 return strlen(msg);
479 #endif
470 } 480 }
471 481
472 char * escape_text2(char *msg) 482 char * escape_text2(char *msg)
473 { 483 {
474 char *c, *cpy; 484 char *c, *cpy;