]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Seperate array elements with commas when pretty-printing
authorTed Lemon <source@isc.org>
Wed, 19 Feb 1997 10:52:14 +0000 (10:52 +0000)
committerTed Lemon <source@isc.org>
Wed, 19 Feb 1997 10:52:14 +0000 (10:52 +0000)
common/options.c
options.c

index 4f73c90041ce71182a7cc8f34f1b3c663c9fa2c4..2f0210ea1c6a5a0c24871838e727c427a58e208c 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: options.c,v 1.20 1997/02/18 14:28:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: options.c,v 1.21 1997/02/19 10:52:14 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #define DHCP_OPTION_DATA
@@ -526,12 +526,14 @@ char *pretty_print_option (code, data, len)
                                warn ("Unexpected format code %c", fmtbuf [j]);
                        }
                        op += strlen (op);
+                       if (j + 1 < numelem)
+                               *op++ = ' ';
+               }
+               if (i + 1 < numhunk) {
+                       *op++ = ',';
                        *op++ = ' ';
                }
+               
        }
-       *--op = 0;
        return optbuf;
 }
-
-                       
-               
index 4f73c90041ce71182a7cc8f34f1b3c663c9fa2c4..2f0210ea1c6a5a0c24871838e727c427a58e208c 100644 (file)
--- a/options.c
+++ b/options.c
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: options.c,v 1.20 1997/02/18 14:28:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: options.c,v 1.21 1997/02/19 10:52:14 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #define DHCP_OPTION_DATA
@@ -526,12 +526,14 @@ char *pretty_print_option (code, data, len)
                                warn ("Unexpected format code %c", fmtbuf [j]);
                        }
                        op += strlen (op);
+                       if (j + 1 < numelem)
+                               *op++ = ' ';
+               }
+               if (i + 1 < numhunk) {
+                       *op++ = ',';
                        *op++ = ' ';
                }
+               
        }
-       *--op = 0;
        return optbuf;
 }
-
-                       
-