Skip to content

Commit 707c91f

Browse files
committed
Adding flags to remove xprintf features.
1 parent 7df33e4 commit 707c91f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libc/src/xprintf.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,11 @@ int vxprintf(func,arg,format,ap)
651651
(*func)(bufpt,length,arg);
652652
count += length;
653653
}
654+
#ifndef XPRINTFNOALLOC
654655
if( xtype==MEM_STRING && zMem ){
655656
free(zMem);
656657
}
658+
#endif
657659
if( flag_leftjustify ){
658660
register int nspace;
659661
nspace = width-length;
@@ -720,6 +722,7 @@ int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap){
720722
return vxprintf(sout,&arg,fmt,ap);
721723
}
722724

725+
#ifndef XPRINTFNOALLOC
723726
/*
724727
** The following section of code handles the mprintf routine, that
725728
** writes to memory obtained from malloc().
@@ -789,7 +792,9 @@ int vasprintf(char ** out, const char *zFormat,va_list ap){
789792
*out = sMprintf.zText;
790793
return r;
791794
}
795+
#endif
792796

797+
#ifndef XPRINTFNOSTDIO
793798
/*
794799
** The following section of code handles the standard fprintf routines
795800
** for pthreads.
@@ -808,3 +813,4 @@ static void fout(zNewText,nNewChar,arg)
808813
int vdprintf(int fd, const char *zFormat, va_list ap){
809814
return vxprintf(fout,&fd,zFormat,ap);
810815
}
816+
#endif

0 commit comments

Comments
 (0)