]>
git.saurik.com Git - apple/system_cmds.git/blob - zic.tproj/scheck.c
2 ** This file is in the public domain, so clarified as of
3 ** 2006-07-17 by Arthur David Olson.
8 static const char elsieid
[] = "@(#)scheck.c 8.19";
9 #endif /* !defined lint */
10 #endif /* !defined NOID */
13 static const char rcsid
[] =
14 "$FreeBSD: head/contrib/tzcode/zic/scheck.c 192625 2009-05-23 06:31:50Z edwin $";
22 scheck(string
, format
)
23 const char * const string
;
24 const char * const format
;
27 register const char * fp
;
30 register const char * result
;
34 if (string
== NULL
|| format
== NULL
)
36 fbuf
= imalloc((int) (2 * strlen(format
) + 4));
41 while ((*tp
++ = c
= *fp
++) != '\0') {
53 if (*fp
== 'l' || *fp
== 'h')
57 while (*fp
!= '\0' && *fp
!= ']');
58 if ((*tp
++ = *fp
++) == '\0')
64 if (sscanf(string
, fbuf
, &dummy
) != 1)
65 result
= (char *) format
;