Remove {v,}sprintf
This commit is contained in:
parent
93100edccb
commit
54ec44dad1
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.80 2014/01/12 15:19:57 tsutsui Exp $
|
||||
# $NetBSD: Makefile,v 1.81 2014/03/26 18:02:24 christos Exp $
|
||||
|
||||
LIB= sa
|
||||
LIBISPRIVATE?= yes
|
||||
|
@ -25,8 +25,8 @@ CPPFLAGS= -I${SADIR} ${SACPPFLAGS} ${SAMISCCPPFLAGS} \
|
|||
# stand routines
|
||||
SRCS+= alloc.c errno.c exit.c files.c \
|
||||
getfile.c gets.c globals.c \
|
||||
panic.c printf.c qsort.c snprintf.c sprintf.c strerror.c \
|
||||
subr_prf.c twiddle.c vsprintf.c checkpasswd.c
|
||||
panic.c printf.c qsort.c snprintf.c strerror.c \
|
||||
subr_prf.c twiddle.c checkpasswd.c
|
||||
|
||||
# string routines
|
||||
.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "x86_64"
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
/* $NetBSD: sprintf.c,v 1.5 2011/07/17 20:54:52 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)printf.c 8.1 (Berkeley) 6/11/93
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "stand.h"
|
||||
|
||||
int
|
||||
sprintf(char *buf, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int len;
|
||||
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(buf, -(size_t)buf, fmt, ap);
|
||||
va_end(ap);
|
||||
return len;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: stand.h,v 1.77 2014/01/05 21:38:25 jakllsch Exp $ */
|
||||
/* $NetBSD: stand.h,v 1.78 2014/03/26 18:02:24 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
|
||||
|
@ -80,9 +80,7 @@
|
|||
#define gets libsa_gets
|
||||
#define printf libsa_printf
|
||||
#define putchar libsa_putchar
|
||||
#define sprintf libsa_sprintf
|
||||
#define vprintf libsa_vprintf
|
||||
#define vsprintf libsa_vsprintf
|
||||
#endif
|
||||
|
||||
struct open_file;
|
||||
|
@ -252,14 +250,10 @@ int dkcksum(const struct disklabel *);
|
|||
|
||||
void printf(const char *, ...)
|
||||
__attribute__((__format__(__printf__, 1, 2)));
|
||||
int sprintf(char *, const char *, ...)
|
||||
__attribute__((__format__(__printf__, 2, 3)));
|
||||
int snprintf(char *, size_t, const char *, ...)
|
||||
__attribute__((__format__(__printf__, 3, 4)));
|
||||
void vprintf(const char *, va_list)
|
||||
__attribute__((__format__(__printf__, 1, 0)));
|
||||
int vsprintf(char *, const char *, va_list)
|
||||
__attribute__((__format__(__printf__, 2, 0)));
|
||||
int vsnprintf(char *, size_t, const char *, va_list)
|
||||
__attribute__((__format__(__printf__, 3, 0)));
|
||||
void twiddle(void);
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/* $NetBSD: vsprintf.c,v 1.5 2011/07/17 20:54:52 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)printf.c 8.1 (Berkeley) 6/11/93
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "stand.h"
|
||||
|
||||
int
|
||||
vsprintf(char *buf, const char *fmt, va_list ap)
|
||||
{
|
||||
|
||||
return vsnprintf(buf, -(size_t)buf, fmt, ap);
|
||||
}
|
Loading…
Reference in New Issue