mdb mesg mined mkdep mkdir mkdist mkfifo mkfs mknod \
mkproto modem mount mt netconf newroot nice nm nohup \
nonamed od packit packman passwd paste patch pax \
- ping postinstall poweroff pr prep printroot \
+ ping postinstall poweroff pr prep printf printroot \
profile progressbar proto pr_routes ps pwd pwdauth \
ramdisk rarpd rawspeed rcp rdate readall readclock \
readfs reboot remsync rev rget rlogin rlogind rmdir \
*/
#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
- The Regents of the University of California. All rights reserved.");
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
-#endif
-__RCSID("$NetBSD: cut.c,v 1.25 2008/07/21 14:19:22 lukem Exp $");
-#endif /* not lint */
#include <ctype.h>
#include <err.h>
#include <wchar.h>
#include <sys/param.h>
+#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
+
static int bflag;
static int cflag;
static char dchar;
while ((ch = getopt(argc, argv, "b:c:d:f:sn")) != -1)
switch(ch) {
case 'b':
+ case 'c':
fcn = b_cut;
get_list(optarg);
bflag = 1;
break;
+#if 0
case 'c':
fcn = c_cut;
get_list(optarg);
cflag = 1;
break;
+#endif
case 'd':
dchar = *optarg;
dflag = 1;
static char *positions = NULL;
static size_t numpositions = 0;
-#define ALLOC_CHUNK _POSIX2_LINE_MAX /* malloc granularity */
+#define ALLOC_CHUNK 4096 /* malloc granularity */
static void
get_list(char *list)
#include "x_cut.c"
#undef CUT_BYTE
+#if 0
/* make c_put(): */
#define CUT_BYTE 0
#include "x_cut.c"
#undef CUT_BYTE
+#endif
*/
#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>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#ifdef __GNUC__
#define ESCAPE '\e'
error = printf(f, func); \
}
+#if 0
#define APF(cpp, f, func) { \
if (fieldwidth != -1) { \
if (precision != -1) \
else \
error = asprintf(cpp, f, func); \
}
+#endif
#ifdef main
int main(int, char *[]);
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;
return *(cp+1);
errno = 0;
- val = strtoimax(cp, &ep, 0);
+ val = strtol(cp, &ep, 0);
check_conversion(cp, ep);
return val;
}
}
errno = 0;
- val = strtoumax(cp, &ep, 0);
+ val = strtoul(cp, &ep, 0);
check_conversion(cp, ep);
return val;
}