sim: split debug/stdio/trace/profile options into dedicated m4 files
[binutils-gdb.git] / gas / sb.c
index ed471b86c07e70573dce43bc56442364585b14e7..08ed8916feb46d1868bc20030b0388cd5e8c5f4b 100644 (file)
--- a/gas/sb.c
+++ b/gas/sb.c
@@ -1,5 +1,5 @@
 /* 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
@@ -24,9 +24,7 @@
 #include "as.h"
 #include "sb.h"
 
-#ifdef HAVE_LIMITS_H
 #include <limits.h>
-#endif
 #ifndef CHAR_BIT
 #define CHAR_BIT 8
 #endif
@@ -59,7 +57,7 @@ static void sb_check (sb *, size_t);
 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;
 }
@@ -147,7 +145,7 @@ sb_check (sb *ptr, size_t len)
 #endif
       max -= MALLOC_OVERHEAD + 1;
       ptr->max = max;
-      ptr->ptr = xrealloc (ptr->ptr, max + 1);
+      ptr->ptr = XRESIZEVEC (char, ptr->ptr, max + 1);
     }
 }