3 static char elsieid[] = "@(#)scheck.c 8.10";
4 #endif /* !defined lint */
5 #endif /* !defined NOID */
11 extern char * imalloc P((int n));
12 extern void ifree P((char * p));
15 scheck(string, format)
16 const char * const string;
17 const char * const format;
20 register const char * fp;
23 register char * result;
27 if (string == NULL || format == NULL)
29 fbuf = imalloc(2 * strlen(format) + 4);
34 while ((*tp++ = c = *fp++) != '\0') {
44 while (isascii(*fp) && isdigit(*fp))
46 if (*fp == 'l' || *fp == 'h')
50 while (*fp != '\0' && *fp != ']');
51 if ((*tp++ = *fp++) == '\0')
57 if (sscanf(string, fbuf, &dummy) != 1)
58 result = (char *) format;