minix cut, printf from netbsd

This commit is contained in:
Ben Gras
2010-06-22 21:22:53 +00:00
parent ff26d9a4ff
commit 988b95f150
5 changed files with 18 additions and 33 deletions
+7 -17
View File
@@ -30,20 +30,6 @@
*/
#include <sys/cdefs.h>
#ifndef lint
#if !defined(BUILTIN) && !defined(SHELL)
__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
The Regents of the University of California. All rights reserved.");
#endif
#endif
#ifndef lint
#if 0
static char sccsid[] = "@(#)printf.c 8.2 (Berkeley) 3/22/95";
#else
__RCSID("$NetBSD: printf.c,v 1.33.8.1 2009/10/14 18:37:30 sborrill Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
@@ -58,6 +44,7 @@ __RCSID("$NetBSD: printf.c,v 1.33.8.1 2009/10/14 18:37:30 sborrill Exp $");
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <inttypes.h>
#ifdef __GNUC__
#define ESCAPE '\e'
@@ -107,6 +94,7 @@ static char **gargv;
error = printf(f, func); \
}
#if 0
#define APF(cpp, f, func) { \
if (fieldwidth != -1) { \
if (precision != -1) \
@@ -118,6 +106,7 @@ static char **gargv;
else \
error = asprintf(cpp, f, func); \
}
#endif
#ifdef main
int main(int, char *[]);
@@ -249,7 +238,8 @@ int main(int argc, char *argv[])
t[b_length] = 0;
/* Get printf to calculate the lengths */
*fmt = 's';
APF(&a, start, t);
abort();
/* APF(&a, start, t); */
if (error == -1)
goto out;
b_fmt = a;
@@ -619,7 +609,7 @@ getintmax(void)
return *(cp+1);
errno = 0;
val = strtoimax(cp, &ep, 0);
val = strtol(cp, &ep, 0);
check_conversion(cp, ep);
return val;
}
@@ -648,7 +638,7 @@ getuintmax(void)
}
errno = 0;
val = strtoumax(cp, &ep, 0);
val = strtoul(cp, &ep, 0);
check_conversion(cp, ep);
return val;
}