diff --git a/RELNOTES b/RELNOTES index 7a67556e..7d9b655b 100644 --- a/RELNOTES +++ b/RELNOTES @@ -75,6 +75,9 @@ work on other platforms. Please report any problems and suggested fixes to - Two uninitialized stack structures are now memset to zero, thanks to a patch from David Cantrell at RedHat. +- Fixed a cosmetic bug where pretty-printing valid domain-search options would + result in an erroneous error log message ('garbage in format string'). + Changes since 4.1.0b1 - A missing "else" in dhcrelay.c could have caused an interface not to diff --git a/common/options.c b/common/options.c index 0a4604ee..fbc1e01a 100644 --- a/common/options.c +++ b/common/options.c @@ -1730,12 +1730,27 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) } fmtbuf [l + 1] = 0; break; + case 'c': + /* The 'c' atom is a 'D' modifier only. */ + log_error("'c' atom not following D atom in format " + "string: %s", option->format); + break; + case 'D': + /* + * Skip the 'c' atom, if present. It does not affect + * how we convert wire->text format (if compression is + * present either way, we still process it). + */ + if (option->format[i+1] == 'c') + i++; + fmtbuf[l + 1] = 0; + numhunk = -2; + break; case 'd': fmtbuf[l] = 't'; /* Fall Through ! */ case 't': - case 'D': - fmtbuf [l + 1] = 0; + fmtbuf[l + 1] = 0; numhunk = -2; break; case 'N':