changeset 62:f4e33f87c803 draft

Clean up some valgrind errors
author Roy Marples <roy@marples.name>
date Wed, 21 Feb 2007 10:50:24 +0000
parents 835ca00adaa9
children ac0bbb204909
files configure.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure.c	Wed Feb 21 10:30:50 2007 +0000
+++ b/configure.c	Wed Feb 21 10:50:24 2007 +0000
@@ -51,10 +51,11 @@
 {
   /* The largest single element we can have is 256 bytes according to the RFC,
      so this buffer size should be safe even if it's all ' */
-  char buffer[1024] = {0};
+  static char buffer[1024]; 
   char *b = buffer;
 
-  if (! cstr || strlen (cstr) == 0)
+  memset (buffer, 0, sizeof (buffer));
+  if (cstr == NULL || strlen (cstr) == 0)
       return b;
 
   do
@@ -343,7 +344,7 @@
     }
 
   if (dhcp->hostname)
-    fprintf (f, "HOSTNAME='%s'\n",cleanmetas (dhcp->hostname));
+    fprintf (f, "HOSTNAME='%s'\n", cleanmetas (dhcp->hostname));
 
   if (dhcp->dnsdomain)
     fprintf (f, "DNSDOMAIN='%s'\n", cleanmetas (dhcp->dnsdomain));