[Pidgin] #1344: fix for some build warnings

Pidgin trac at pidgin.im
Sun Jun 3 10:39:23 EDT 2007


#1344: fix for some build warnings
----------------------------+-----------------------------------------------
  Reporter:  o_sukhodolsky  |       Owner:  rlaager 
      Type:  patch          |      Status:  assigned
  Priority:  minor          |   Milestone:  2.0.2   
 Component:  pidgin (gtk)   |     Version:  2.0.1   
Resolution:                 |    Keywords:          
   Pending:  0              |  
----------------------------+-----------------------------------------------
Comment (by o_sukhodolsky):

 I've been looking at trillian_logger_read()
 (libpurple/plugins/log_reader.c) (it is about change
 this code to not file warnings)
 And I have couple questions:
 {{{
 while ((link = g_strstr_len(line, strlen(line), "(Link: "))) {
         GString *temp;
         if (!*link)
                 continue;
 }}}

 why do you need this if? I can not imagine case when it may works :(
 perhaps it is an
 old/obsolete code)

 {{{
 link += (sizeof("(Link: ") - 1);
 }}}

 I think it is supposed to use strlen() instead of sizeof() (which counts
 '\0') here.
 Am I right?

 {{{
 while (*link && *link != ')') {
         g_string_append_c(temp, *link);
         link++;
 }
 if (link) {
 }}}

 perhaps this if should check "*link", but not "link".

-- 
Ticket URL: <http://developer.pidgin.im/ticket/1344#comment:43>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list