summaryrefslogtreecommitdiffstats
path: root/lib/libc/time/scheck.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-02-09 12:37:47 +0000
committertedu <tedu@openbsd.org>2015-02-09 12:37:47 +0000
commit2059035fa8a47acdbf6eaee6fc96e70cec06470d (patch)
tree1d8e48b30c041db569b1e0e2665aab49093f6c53 /lib/libc/time/scheck.c
parentuse atomic ops to increment and decrement the device ref count in (diff)
downloadwireguard-openbsd-2059035fa8a47acdbf6eaee6fc96e70cec06470d.tar.xz
wireguard-openbsd-2059035fa8a47acdbf6eaee6fc96e70cec06470d.zip
move zic and zdump source to appropriate directories
Diffstat (limited to 'lib/libc/time/scheck.c')
-rw-r--r--lib/libc/time/scheck.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/lib/libc/time/scheck.c b/lib/libc/time/scheck.c
deleted file mode 100644
index e4f3b145b6a..00000000000
--- a/lib/libc/time/scheck.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $OpenBSD: scheck.c,v 1.11 2015/02/09 11:29:19 tedu Exp $ */
-/*
-** This file is in the public domain, so clarified as of
-** 2006-07-17 by Arthur David Olson.
-*/
-
-/*LINTLIBRARY*/
-
-#include "private.h"
-
-const char *
-scheck(string, format)
-const char * const string;
-const char * const format;
-{
- register char * fbuf;
- register const char * fp;
- register char * tp;
- register int c;
- register const char * result;
- char dummy;
-
- result = "";
- if (string == NULL || format == NULL)
- return result;
- fbuf = malloc((int) (2 * strlen(format) + 4));
- if (fbuf == NULL)
- return result;
- fp = format;
- tp = fbuf;
- while ((*tp++ = c = *fp++) != '\0') {
- if (c != '%')
- continue;
- if (*fp == '%') {
- *tp++ = *fp++;
- continue;
- }
- *tp++ = '*';
- if (*fp == '*')
- ++fp;
- while (is_digit(*fp))
- *tp++ = *fp++;
- if (*fp == 'l' || *fp == 'h')
- *tp++ = *fp++;
- else if (*fp == '[')
- do *tp++ = *fp++;
- while (*fp != '\0' && *fp != ']');
- if ((*tp++ = *fp++) == '\0')
- break;
- }
- *(tp - 1) = '%';
- *tp++ = 'c';
- *tp = '\0';
- if (sscanf(string, fbuf, &dummy) != 1)
- result = (char *) format;
- free(fbuf);
- return result;
-}