/* sb.c - string buffer manipulation routines
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2021 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
#include "as.h"
#include "sb.h"
-#ifdef HAVE_LIMITS_H
#include <limits.h>
-#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif
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;
}
#endif
max -= MALLOC_OVERHEAD + 1;
ptr->max = max;
- ptr->ptr = xrealloc (ptr->ptr, max + 1);
+ ptr->ptr = XRESIZEVEC (char, ptr->ptr, max + 1);
}
}