~ubuntu-branches/ubuntu/intrepid/djbdns/intrepid-updates

« back to all changes in this revision

Viewing changes to stralloc_catb.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape
  • Date: 2008-03-02 23:22:04 UTC
  • Revision ID: james.westby@ubuntu.com-20080302232204-wa3owprcpeiyu8kj
Tags: upstream-1.05
ImportĀ upstreamĀ versionĀ 1.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "stralloc.h"
 
2
#include "byte.h"
 
3
 
 
4
int stralloc_catb(stralloc *sa,const char *s,unsigned int n)
 
5
{
 
6
  if (!sa->s) return stralloc_copyb(sa,s,n);
 
7
  if (!stralloc_readyplus(sa,n + 1)) return 0;
 
8
  byte_copy(sa->s + sa->len,n,s);
 
9
  sa->len += n;
 
10
  sa->s[sa->len] = 'Z'; /* ``offensive programming'' */
 
11
  return 1;
 
12
}