xref: /plan9-contrib/sys/src/cmd/unix/drawterm/libc/fmtstr.c (revision 0d601874851962e88c6c60fdd2e637bba04e13c2)
1*0d601874SDavid du Colombier /*
2*0d601874SDavid du Colombier  * The authors of this software are Rob Pike and Ken Thompson.
3*0d601874SDavid du Colombier  *              Copyright (c) 2002 by Lucent Technologies.
4*0d601874SDavid du Colombier  * Permission to use, copy, modify, and distribute this software for any
5*0d601874SDavid du Colombier  * purpose without fee is hereby granted, provided that this entire notice
6*0d601874SDavid du Colombier  * is included in all copies of any software which is or includes a copy
7*0d601874SDavid du Colombier  * or modification of this software and in all copies of the supporting
8*0d601874SDavid du Colombier  * documentation for such software.
9*0d601874SDavid du Colombier  * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
10*0d601874SDavid du Colombier  * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE
11*0d601874SDavid du Colombier  * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
12*0d601874SDavid du Colombier  * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
13*0d601874SDavid du Colombier  */
148ccd4a63SDavid du Colombier #include <u.h>
158ccd4a63SDavid du Colombier #include <libc.h>
16*0d601874SDavid du Colombier #include "fmtdef.h"
178ccd4a63SDavid du Colombier 
188ccd4a63SDavid du Colombier char*
198ccd4a63SDavid du Colombier fmtstrflush(Fmt *f)
208ccd4a63SDavid du Colombier {
218ccd4a63SDavid du Colombier 	if(f->start == nil)
228ccd4a63SDavid du Colombier 		return nil;
238ccd4a63SDavid du Colombier 	*(char*)f->to = '\0';
24*0d601874SDavid du Colombier 	return (char*)f->start;
258ccd4a63SDavid du Colombier }
26