From: Ralph Corderoy Date: Thu, 24 Aug 2017 19:09:00 +0000 (+0100) Subject: Format with `%#x' instead of `0x%x' if difference matters not. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d2d531f4cd2b0f5c48c16f6b4ec101df6bd00eb1 Format with `%#x' instead of `0x%x' if difference matters not. Zero formats as `0' rather than `0x0', but that doesn't matter in debug output, or an error message about a byte's value to the user. --- diff --git a/sbr/datetime.c b/sbr/datetime.c index 9ecff53c..68038cfc 100644 --- a/sbr/datetime.c +++ b/sbr/datetime.c @@ -75,7 +75,7 @@ parse_datetime (const char *datetime, const char *zone, int dst, if (items_matched == 7) { /* The 'Z' must be capital according to RFC 5545 Sec. 3.3.5. */ if (utc_indicator != 'Z') { - inform("%s has invalid timezone indicator of 0x%x", + inform("%s has invalid timezone-indicator byte: %#x", datetime, utc_indicator); return NOTOK; } diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index cda4e48f..48a5a794 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -269,7 +269,7 @@ list_debug (CT ct) get_param_value(pm, '?')); /* print internal flags for type/subtype */ - fprintf (stderr, " type 0x%x subtype 0x%x params 0x%x\n", + fprintf (stderr, " type %#x subtype %#x params 0x%x\n", ct->c_type, ct->c_subtype, (unsigned int)(unsigned long) ct->c_ctparams); @@ -282,7 +282,7 @@ list_debug (CT ct) fprintf (stderr, " %s:%s", ENCODING_FIELD, ct->c_celine); /* print internal flags for transfer encoding */ - fprintf (stderr, " transfer encoding 0x%x params 0x%x\n", + fprintf (stderr, " transfer encoding %#x params 0x%x\n", ct->c_encoding, (unsigned int)(unsigned long) &ct->c_cefile); /* print Content-ID */