]> sjero.net Git - wget/blobdiff - src/log.c
[svn] Use new macros xnew, xnew0, xnew_array, and xnew0_array in various places.
[wget] / src / log.c
index 578b0c1f5520e7e5b666473eed6426169fced05e..4befb998d85ba1c533a9daaac09cda02319d8ce1 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -62,6 +62,7 @@ so, delete this exception statement from your version.  */
 
 #include "wget.h"
 #include "utils.h"
+#include "log.h"
 
 #ifndef errno
 extern int errno;
@@ -232,7 +233,7 @@ saved_append_1 (const char *start, const char *end)
            {
              /* Allocate memory and concatenate the old and the new
                  contents. */
-             ln->malloced_line = xmalloc (old_len + len + 1);
+             ln->malloced_line = (char *)xmalloc (old_len + len + 1);
              memcpy (ln->malloced_line, ln->static_line,
                      old_len);
              memcpy (ln->malloced_line + old_len, start, len);
@@ -499,7 +500,7 @@ logprintf (enum log_options o, const char *fmt, ...)
     return;
   CHECK_VERBOSE (o);
 
-  memset (&lpstate, '\0', sizeof (lpstate));
+  xzero (lpstate);
   do
     {
       VA_START (args, fmt);
@@ -509,7 +510,7 @@ logprintf (enum log_options o, const char *fmt, ...)
   while (!done);
 }
 
-#ifdef DEBUG
+#ifdef ENABLE_DEBUG
 /* The same as logprintf(), but does anything only if opt.debug is
    non-zero.  */
 void
@@ -525,7 +526,7 @@ debug_logprintf (const char *fmt, ...)
       if (inhibit_logging)
        return;
 
-      memset (&lpstate, '\0', sizeof (lpstate));
+      xzero (lpstate);
       do
        {
          VA_START (args, fmt);
@@ -535,7 +536,7 @@ debug_logprintf (const char *fmt, ...)
       while (!done);
     }
 }
-#endif /* DEBUG */
+#endif /* ENABLE_DEBUG */
 \f
 /* Open FILE and set up a logging stream.  If FILE cannot be opened,
    exit with status of 1.  */