/[muddleftpd]/muddleftpd/src/string.c
ViewVC logotype

Diff of /muddleftpd/src/string.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by rugger, Tue Oct 29 09:13:31 2002 UTC revision 1.4 by rugger, Sun Nov 2 13:06:10 2003 UTC
# Line 51  void string_dropfront(STRING **s, int nc Line 51  void string_dropfront(STRING **s, int nc
51          }          }
52  }  }
53    
54  void string_catvprintf(STRING **s, char *format, va_list ap)  void string_catvprintf(STRING **s, int len, char *format, va_list ap)
55  {  {
         int len;  
           
         len = vsnprintf(NULL, 0, format, ap);  
           
56          if (STRLENGTH(*s) + len >= MINLEN)          if (STRLENGTH(*s) + len >= MINLEN)
57                  reallocwrapper(len + STRCURSIZE(*s), (void *)s);                  reallocwrapper(len + STRCURSIZE(*s), (void *)s);
58                    
# Line 68  void string_catvprintf(STRING **s, char Line 64  void string_catvprintf(STRING **s, char
64  void string_catprintf(STRING **s, char *format, ...)  void string_catprintf(STRING **s, char *format, ...)
65  {  {
66          va_list printfargs;          va_list printfargs;
67            int len;
68            
69            va_start(printfargs, format);
70            len = vsnprintf(NULL, 0, format, printfargs);
71            va_end(printfargs);
72                    
73          va_start(printfargs, format);          va_start(printfargs, format);
74          string_catvprintf(s, format, printfargs);          string_catvprintf(s, len, format, printfargs);
75          va_end(printfargs);          va_end(printfargs);
76  }  }
77    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26