]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
fix format code 'Z'
authorFrancis Dupont <fdupont@isc.org>
Thu, 12 Jun 2008 13:27:55 +0000 (13:27 +0000)
committerFrancis Dupont <fdupont@isc.org>
Thu, 12 Jun 2008 13:27:55 +0000 (13:27 +0000)
RELNOTES
common/options.c

index 7e74dbe5d242a98999733d9ea6fbf87323144115..56f664ff78a73cf6c7b99cdbfe9f1b3133cb0487 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -89,6 +89,8 @@ work on other platforms. Please report any problems and suggested fixes to
 - A double-dereference in dhclient transmission of DHCPDECLINEs was
   repaired.
 
+- Fix handling of format code 'Z'.
+
                        Changes since 4.0.0 (new features)
 
 - Added DHCPv6 rapid commit support.
index 72b05863d586dcd1f982b21bf7a33c0addff9bbe..c4de1e406367945224893de9bfb936ba63671508 100644 (file)
@@ -1631,6 +1631,7 @@ format_min_length(format, oc)
                    case 'x': /* "Hex" */
                    case 'A': /* Array of all that precedes. */
                    case 'a': /* Array of preceding symbol. */
+                   case 'Z': /* nothing. */
                        return min_len;
 
                    case 'c': /* Compress flag for D atom. */
@@ -1773,10 +1774,12 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
                      case 'b':
                      case 'B':
                      case 'f':
+                     case 'F':
                        hunksize++;
                        hunkinc = 1;
                        break;
                      case 'e':
+                     case 'Z':
                        break;
                      case 'o':
                        opthunk += hunkinc;
@@ -1989,12 +1992,20 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
                              case 'B':
                                sprintf (op, "%d", *dp++);
                                break;
+                             case 'X':
                              case 'x':
                                sprintf (op, "%x", *dp++);
                                break;
                              case 'f':
                                strcpy (op, *dp++ ? "true" : "false");
                                break;
+                             case 'F':
+                               strcpy (op, "true");
+                               break;
+                             case 'e':
+                             case 'Z':
+                               *op = '\0';
+                               break;
                              default:
                                log_error ("Unexpected format code %c",
                                           fmtbuf [j]);