Skip to content

main.c: do not print a NULL charset name - #78

Merged
rrthomas merged 1 commit into
rrthomas:masterfrom
prownd:main.c-do-not-print-a-NULL-charset-name-s01
Sep 23, 2026
Merged

rrthomas merged 1 commit into
rrthomas:masterfrom
prownd:main.c-do-not-print-a-NULL-charset-name-s01

Conversation

@prownd

@prownd prownd commented Sep 21, 2026

Copy link
Copy Markdown

When listing with a format or with --known but without a charset, recode(1) uses the default charset. If that charset is unknown, the error message used argv[optind], which is NULL at that point:

$ DEFAULT_CHARSET=no-such-charset recode -ld
recode: Charset `(null)' is unknown or ambiguous

Report the default charset name instead.

When listing with a format or with --known but without a charset,
recode(1) uses the default charset.  If that charset is unknown, the
error message used argv[optind], which is NULL at that point:

  $ DEFAULT_CHARSET=no-such-charset recode -ld
  recode: Charset `(null)' is unknown or ambiguous

Report the default charset name instead.
@rrthomas
rrthomas merged commit 5f99dbc into rrthomas:master Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants