pike.git/
src/
stralloc.c
Branch:
Tag:
Non-build tags
All tags
No tags
2011-01-11
2011-01-11 11:57:02 by Arne Goedeke <el@laramies.com>
b963e5a5f302cc502104bf1a1dd49b25c5b63547 (
8
lines) (+
7
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
stralloc.c: added sanity check to string_builder_putchars
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
||
$Id: stralloc.c,v 1.239 2010/06/15 16:10:19 grubba Exp $
+
||
$Id$
*/ #include "global.h"
2333:
ptrdiff_t len = s->s->len; int mag = min_magnitude(ch);
+
// This is not really expected to happen. But since we are doing
+
// memset here, a negative argument should be avoided.
+
if (count < 0) Pike_fatal("Non-positive count in call to string_builder_putchars().\n");
+
if (!count) return;
+
string_build_mkspace(s, count, mag); if (mag > s->known_shift) { s->known_shift = mag;