3 static char elsieid
[] = "@(#)scheck.c 8.12";
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
;
20 register const char * fp
;
23 register char * result
;
28 if (string
== NULL
|| format
== NULL
)
30 fbuf
= imalloc((int) (2 * strlen(format
) + 4));
35 while ((*tp
++ = c
= *fp
++) != '\0') {
45 while (isascii(*fp
) && isdigit(*fp
))
47 if (*fp
== 'l' || *fp
== 'h')
51 while (*fp
!= '\0' && *fp
!= ']');
52 if ((*tp
++ = *fp
++) == '\0')
58 if (sscanf(string
, fbuf
, &dummy
) != 1)
59 result
= (char *) format
;