]> sjero.net Git - wget/blobdiff - src/html-url.c
[svn] Use new macros xnew, xnew0, xnew_array, and xnew0_array in various places.
[wget] / src / html-url.c
index f37ac85ee2a776ffcbd407286397c11773efdfb0..e26bd175afbec962eafe44ea79dd0a7c3f7bbdff 100644 (file)
@@ -327,9 +327,7 @@ append_url (const char *link_uri,
 
   DEBUGP (("appending \"%s\" to urlpos.\n", url->url));
 
-  newel = (struct urlpos *)xmalloc (sizeof (struct urlpos));
-  memset (newel, 0, sizeof (*newel));
-
+  newel = xnew0 (struct urlpos);
   newel->next = NULL;
   newel->url = url;
   newel->pos = tag->attrs[attrind].value_raw_beginning - ctx->text;
@@ -700,8 +698,7 @@ get_urls_file (const char *file)
        }
       xfree (url_text);
 
-      entry = (struct urlpos *)xmalloc (sizeof (struct urlpos));
-      memset (entry, 0, sizeof (*entry));
+      entry = xnew0 (struct urlpos);
       entry->next = NULL;
       entry->url = url;