+Mon Sep 12 19:26:06 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+ * dictionary.[ch] Changed cnt from size_t* to int* since that's
+ what it's called as, and on x86_64 machines they're different sizes.
+
+ * str.c: (ds_vprintf) Copied va_list args so they can be re-used
+
Sun Aug 21 00:12:24 2005 Ben Pfaff <blp@gnu.org>
* lexer.c: (lex_sbc_only_once) New function.
exclude ordinary, system, and/or scratch variables. */
void
dict_get_vars (const struct dictionary *d, struct variable ***vars,
- size_t *cnt, unsigned exclude_classes)
+ int *cnt, unsigned exclude_classes)
{
size_t count;
size_t i;
size_t dict_get_var_cnt (const struct dictionary *);
struct variable *dict_get_var (const struct dictionary *, size_t idx);
void dict_get_vars (const struct dictionary *,
- struct variable ***vars, size_t *cnt,
+ struct variable ***vars, int *cnt,
unsigned exclude_classes);
struct variable *dict_create_var (struct dictionary *, const char *,
been written. */
int avail, needed;
+ va_list a1;
+ va_copy(a1, args);
avail = st->capacity - st->length + 1;
needed = vsnprintf (st->string + st->length, avail, format, args);
{
ds_extend (st, st->length + needed);
- vsprintf (st->string + st->length, format, args);
+ vsprintf (st->string + st->length, format, a1);
}
else
while (needed == -1)
{
+ va_list a2;
+ va_copy(a2, a1);
+
ds_extend (st, (st->capacity + 1) * 2);
avail = st->capacity - st->length + 1;
- needed = vsnprintf (st->string + st->length, avail, format, args);
+ needed = vsnprintf (st->string + st->length, avail, format, a2);
+ va_end(a2);
}
+ va_end(a1);
st->length += needed;
}