diff options
author | Neal H. Walfield <[email protected]> | 2016-12-02 10:06:25 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2016-12-02 10:07:04 +0000 |
commit | cd532bb7b866e104304e2443cc942799c385daa5 (patch) | |
tree | 2615d44ad520b207ff58f3e6d9b535140a593d2e /g10/tofu.c | |
parent | g10: In the TOFU module, make strings easier to translate. (diff) | |
download | gnupg-cd532bb7b866e104304e2443cc942799c385daa5.tar.gz gnupg-cd532bb7b866e104304e2443cc942799c385daa5.zip |
g10: Improve debugging output.
* g10/tofu.c (string_to_long): Improve debugging output.
(string_to_ulong): Likewise.
Signed-off-by: Neal H. Walfield <[email protected]>
Diffstat (limited to 'g10/tofu.c')
-rw-r--r-- | g10/tofu.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/g10/tofu.c b/g10/tofu.c index c307d2575..18f9c5486 100644 --- a/g10/tofu.c +++ b/g10/tofu.c @@ -410,9 +410,12 @@ string_to_long (long *r_value, const char *string, long fallback, int line) if (errno || !(!strcmp (tail, ".0") || !*tail)) { err = errno? gpg_error_from_errno (errno) : gpg_error (GPG_ERR_BAD_DATA); - log_debug ("%s:%d: " - "strtol failed for DB returned string (tail=%.10s): %s\n", - __FILE__, line, tail, gpg_strerror (err)); + log_debug ("%s:%d: strtol failed for TOFU DB data; returned string" + " (string='%.10s%s'; tail='%.10s%s'): %s\n", + __FILE__, line, + string, string && strlen(string) > 10 ? "..." : "", + tail, tail && strlen(tail) > 10 ? "..." : "", + gpg_strerror (err)); *r_value = fallback; } else @@ -438,9 +441,12 @@ string_to_ulong (unsigned long *r_value, const char *string, if (errno || !(!strcmp (tail, ".0") || !*tail)) { err = errno? gpg_error_from_errno (errno) : gpg_error (GPG_ERR_BAD_DATA); - log_debug ("%s:%d: " - "strtoul failed for DB returned string (tail=%.10s): %s\n", - __FILE__, line, tail, gpg_strerror (err)); + log_debug ("%s:%d: strtoul failed for TOFU DB data; returned string" + " (string='%.10s%s'; tail='%.10s%s'): %s\n", + __FILE__, line, + string, string && strlen(string) > 10 ? "..." : "", + tail, tail && strlen(tail) > 10 ? "..." : "", + gpg_strerror (err)); *r_value = fallback; } else |