summaryrefslogtreecommitdiff
path: root/sys/src/libString/s_terminate.c
blob: c248d8b16afde141cad730573e3fd02d4721e7fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <u.h>
#include <libc.h>
#include "String.h"

void
s_terminate(String *s)
{
	if(s->ref > 1)
		sysfatal("can't s_terminate a shared string");
	if (s->ptr >= s->end)
		s_grow(s, 1);
	*s->ptr = 0;
}