mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-12-08 20:25:13 +00:00
more versatile
SCCS-file: scheck.c SCCS-SID: 7.6
This commit is contained in:
committed by
Paul Eggert
parent
cc39bbb7fb
commit
ef3e352a39
12
scheck.c
12
scheck.c
@ -29,6 +29,7 @@ char * format;
|
|||||||
register char * tp;
|
register char * tp;
|
||||||
register int c;
|
register int c;
|
||||||
register char * result;
|
register char * result;
|
||||||
|
char dummy;
|
||||||
|
|
||||||
if (string == NULL || format == NULL)
|
if (string == NULL || format == NULL)
|
||||||
return "";
|
return "";
|
||||||
@ -59,9 +60,14 @@ char * format;
|
|||||||
}
|
}
|
||||||
if (c != '\0')
|
if (c != '\0')
|
||||||
result = "";
|
result = "";
|
||||||
else if (sscanf(string, fbuf) != EOF)
|
else {
|
||||||
result = "";
|
*(tp - 1) = '%';
|
||||||
else result = format;
|
*tp++ = 'c';
|
||||||
|
*tp++ = '\0';
|
||||||
|
if (sscanf(string, fbuf, &dummy) == 1)
|
||||||
|
result = "";
|
||||||
|
else result = format;
|
||||||
|
}
|
||||||
free(fbuf);
|
free(fbuf);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user