print warning when ignoring unknown charset

This commit is contained in:
Erik Auerswald
2024-11-17 19:25:33 +01:00
parent 4ab3869eea
commit acdf26c6bf
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ charset_t parse_charset(char *keyword)
} else if(strncasecmp(keyword, "tt_robot", 8) == 0) {
return CS_TT_ROBOT;
} else {
return DEFAULT_CHARSET;
return CS_PARSE_ERROR;
}
}
+2 -1
View File
@@ -202,7 +202,8 @@ typedef enum charset_e {
CS_DIGITS,
CS_DECIMAL,
CS_HEXADECIMAL,
CS_TT_ROBOT
CS_TT_ROBOT,
CS_PARSE_ERROR
} charset_t;
#define DEFAULT_CHARSET CS_FULL
+4
View File
@@ -558,6 +558,10 @@ int main(int argc, char **argv)
case 'c':
if(optarg) {
charset = parse_charset(optarg);
if(charset == CS_PARSE_ERROR) {
fprintf(stderr, PROG ": warning: ignoring --charset=%s\n", optarg);
charset = DEFAULT_CHARSET;
}
}
break;
case 'H':