Mercurial > pidgin.yaz
comparison src/protocols/msn/slp.c @ 9739:35f22ba01bd7
[gaim-migrate @ 10603]
bug fix.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 11 Aug 2004 18:05:10 +0000 |
parents | 7a8aa87164ae |
children | 1e9ecca6c97e |
comparison
equal
deleted
inserted
replaced
9738:d9e8d420e9fe | 9739:35f22ba01bd7 |
---|---|
643 | 643 |
644 /* Eww */ | 644 /* Eww */ |
645 if ((c = strchr(status, '\r')) || (c = strchr(status, '\n')) || | 645 if ((c = strchr(status, '\r')) || (c = strchr(status, '\n')) || |
646 (c = strchr(status, '\0'))) | 646 (c = strchr(status, '\0'))) |
647 { | 647 { |
648 strncpy(temp, status, c - status); | 648 size_t offset = c - status; |
649 temp[c - status] = '\0'; | 649 if (offset >= sizeof(temp)) |
650 offset = sizeof(temp) - 1; | |
651 | |
652 strncpy(temp, status, offset); | |
653 temp[offset] = '\0'; | |
650 } | 654 } |
651 | 655 |
652 gaim_debug_error("msn", "Received non-OK result: %s\n", temp); | 656 gaim_debug_error("msn", "Received non-OK result: %s\n", temp); |
653 | 657 |
654 slpcall->wasted = TRUE; | 658 slpcall->wasted = TRUE; |