diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
| commit | 69aec538b456402170dc723af417ba5c05389c32 (patch) | |
| tree | e6f34c543f17c6392447ea337b2e2868212424d1 /stralloc_opyb.c | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'stralloc_opyb.c')
| -rw-r--r-- | stralloc_opyb.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/stralloc_opyb.c b/stralloc_opyb.c new file mode 100644 index 0000000..ac258b3 --- /dev/null +++ b/stralloc_opyb.c | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #include "stralloc.h" | ||
| 2 | #include "byte.h" | ||
| 3 | |||
| 4 | int stralloc_copyb(sa,s,n) | ||
| 5 | stralloc *sa; | ||
| 6 | char *s; | ||
| 7 | unsigned int n; | ||
| 8 | { | ||
| 9 | if (!stralloc_ready(sa,n + 1)) return 0; | ||
| 10 | byte_copy(sa->s,n,s); | ||
| 11 | sa->len = n; | ||
| 12 | sa->s[n] = 'Z'; /* ``offensive programming'' */ | ||
| 13 | return 1; | ||
| 14 | } | ||
