02111-1307, USA. */
#include <config.h>
+#include "str.h"
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include "alloc.h"
#include "error.h"
#include "pool.h"
-#include "str.h"
\f
/* sprintf() wrapper functions for convenience. */
void
ds_concat (struct string *st, const char *s)
{
- size_t s_len = strlen (s);
+ size_t s_len;
+
+ if (!s) return;
+
+ s_len = strlen (s);
ds_extend (st, st->length + s_len);
strcpy (st->string + st->length, s);
st->length += s_len;