_sprintf.c

来自「一个c语言写做的编译器的源码」· C语言 代码 · 共 17 行

C
17
字号
/*@A (C) 1992 Allen I. Holub                                                */
/* The ANSI sprintf() returns the size of the target string. Provide an
 * ANSI-compatible version for UNIX. (It's called _sprintf to avoid possible
 * redefinition conflicts with declarations in header files).
 */

#include <stdarg.h>

int 	_sprintf( buf, fmt  VA_LIST )
char	*buf, *fmt;
{
    va_list   args;
    va_start( args,   fmt );
    vsprintf( buf, fmt, args );     /* defined in /src/compiler/lib/prnt.c */
    return( strlen( buf ) );
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?