Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18822/src
Modified Files:
helpfile.c
Log Message:
use __va_copy() instead of reusing va_lists
Index: helpfile.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpfile.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** helpfile.c 25 Oct 2002 13:03:52 -0000 1.57
--- helpfile.c 5 Nov 2002 03:10:35 -0000 1.58
***************
*** 152,155 ****
--- 152,156 ----
unsigned int size, pos, length, chars_sent;
int ret, use_color;
+ va_list working;
if (IsChannelName(dest) || *dest == '$') {
***************
*** 169,180 ****
* The kludge-around is to pass a non-NULL pointer instead.
*/
! if ((ret = vsnprintf(line, 0, format, al)) <= 0) {
char *temp;
/* non-C99 behavior */
size = strlen(format);
input = malloc(size);
! while ((ret = vsnprintf(input, size, format, al)) == -1) {
size <<= 1;
input = realloc(input, size);
}
temp = alloca(ret+1);
--- 170,186 ----
* The kludge-around is to pass a non-NULL pointer instead.
*/
! __va_copy(working, al);
! if ((ret = vsnprintf(line, 0, format, working)) <= 0) {
char *temp;
/* non-C99 behavior */
size = strlen(format);
input = malloc(size);
! va_end(working);
! __va_copy(working, al);
! while ((ret = vsnprintf(input, size, format, working)) == -1) {
size <<= 1;
input = realloc(input, size);
+ va_end(working);
+ __va_copy(working, al);
}
temp = alloca(ret+1);
***************
*** 186,189 ****
--- 192,197 ----
size = ret + 1;
input = alloca(size);
+ va_end(working);
+ __va_copy(working, al);
ret = vsnprintf(input, size, format, al);
}
|