Strzero.c (208B)
1 #include "std.h" 2 3 void 4 Strzero(String *p) 5 { 6 if (p->size > STRSIZ) { 7 p->size = STRSIZ; 8 p->s = realloc(p->s, p->size); 9 if (!p->s) 10 sysfatal("realloc(): %r"); 11 } 12 p->n = 0; 13 memset(p->s, 0, p->size); 14 }
![]() | plan9portfork of plan9port with libvec, libstr and libsdb |
Log | Files | Refs | README | LICENSE |