/* sb.c - string buffer manipulation routines
- Copyright 1994, 1995, 2000, 2003, 2005, 2006, 2007, 2009, 2012
- Free Software Foundation, Inc.
+ Copyright (C) 1994-2015 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
{
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);
if ((ssize_t) want < 0)
as_fatal ("string buffer overflow");
#if GCC_VERSION >= 3004
- max = (size_t) 1 << (CHAR_BIT * sizeof (want) - __builtin_clzl (want));
+ max = (size_t) 1 << (CHAR_BIT * sizeof (want)
+ - (sizeof (want) <= sizeof (long)
+ ? __builtin_clzl ((long) want)
+ : __builtin_clzll ((long long) want)));
#else
max = 128;
while (want > max)