/* sb.c - string buffer manipulation routines
- Copyright 1994, 1995, 2000, 2003, 2005, 2006, 2007, 2009, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2020 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
void
sb_build (sb *ptr, size_t size)
{
- ptr->ptr = xmalloc (size + 1);
+ ptr->ptr = XNEWVEC (char, size + 1);
ptr->max = size;
ptr->len = 0;
}
{
sb_to_scrub = s;
scrub_position = s->ptr;
-
+
sb_check (ptr, s->len);
ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, s->len);
#endif
max -= MALLOC_OVERHEAD + 1;
ptr->max = max;
- ptr->ptr = xrealloc (ptr->ptr, max + 1);
+ ptr->ptr = XRESIZEVEC (char, ptr->ptr, max + 1);
}
}