Home GnuPG
Diffusion GnuPG b7fa4960c292

common: Minor fixes for the new private-keys.c.
b7fa4960c292Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

common: Minor fixes for the new private-keys.c.

* common/private-keys.c (my_error_from_syserror): New.  Use it in
place of gpg_error_from_syserror.
(_pkc_add, pkc_lookup, pke_next_value): Use ascii_strcasecmp.
(pkc_parse): Use xtrystrdup and append_to_strlist_try as intended.
(_pkc_add): Add braces around if-statement.

We should have a macro so that we do not need to define a wrapper
function like my_error_from_syserror in files where it is needed. I
am not sure about a proper name, "my_" seems to be the easiest
replacement. Note that the global DEFAULT_ERRSOURCE is relatively new
to replace the need to convey the error source in function calls; we
want that function from common/ return the error source of the main
binary.

We require that a key is ASCII and thus we better use ascii_strcasecmp
to avoid problems with strange locales.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Apr 25 2016, 6:14 PM
Parents
rG2502a76d8edb: doc: Explain use of common error variable names.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rGb7fa4960c292: common: Minor fixes for the new private-keys.c. (authored by Werner Koch <wk@gnupg.org>).Apr 25 2016, 6:14 PM