dernier commit avant le Gers

This commit is contained in:
tTh
2024-03-11 02:20:47 +01:00
parent c5b0e17bbb
commit 0818f87582
9 changed files with 99 additions and 23 deletions

View File

@@ -1,7 +1,7 @@
# Outils divers
OK, let's go for a few nice tools.
*OK, let's go for a few nice tools.*
## non ascii ?

View File

@@ -10,26 +10,29 @@
/* ------------------------------------------------------------------ */
int check_a_file_by_fp(FILE *fp, char *filename)
{
int input, linenum, count;
int input, linenum, colnum, count;
int flagline;
linenum = 1; /* humans start line count at 1 */
colnum = 1;
count = 0;
while (EOF != (input=getc(stdin))) {
if ('\n' == input) {
linenum++;
flagline = 0;
colnum = 1;
}
if ((input < 0) || (input>127)) {
if (!flagline) {
fprintf(stderr, "%s: non ascii 0x%x line %d\n",
fprintf(stderr, "%s: nonascii 0x%x line %d, col %d\n",
filename,
input, linenum);
input, linenum, colum);
flagline = 1;
}
count++;
}
colnum++;
}
return count;
}