X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fftp-ls.c;h=7e448295e64f82d9bb5631185d2b0afe26a0c459;hb=e24bc5db1b2613cc669ec4d8b91477bdf0be5084;hp=dd703dfd193d9e3773fd8745959028de9b2d8554;hpb=2219d47ba301c3ea47b36291dda8eabead0fc75d;p=wget diff --git a/src/ftp-ls.c b/src/ftp-ls.c index dd703dfd..7e448295 100644 --- a/src/ftp-ls.c +++ b/src/ftp-ls.c @@ -32,16 +32,12 @@ so, delete this exception statement from your version. */ #include #include -#ifdef HAVE_STRING_H -# include -#else -# include -#endif +#include #ifdef HAVE_UNISTD_H # include #endif -#include #include +#include #include "wget.h" #include "utils.h" @@ -334,7 +330,7 @@ ftp_parse_unix_ls (const char *file, int ignore_perms) default -F output. I believe these cases are very rare. */ fnlen = strlen (tok); /* re-calculate `fnlen' */ - cur.name = (char *)xmalloc (fnlen + 1); + cur.name = xmalloc (fnlen + 1); memcpy (cur.name, tok, fnlen + 1); if (fnlen) { @@ -779,14 +775,14 @@ ftp_parse_vms_ls (const char *file) /* And put everything into the linked list */ if (!dir) { - l = dir = (struct fileinfo *)xmalloc (sizeof (struct fileinfo)); + l = dir = xnew (struct fileinfo); memcpy (l, &cur, sizeof (cur)); l->prev = l->next = NULL; } else { cur.prev = l; - l->next = (struct fileinfo *)xmalloc (sizeof (struct fileinfo)); + l->next = xnew (struct fileinfo); l = l->next; memcpy (l, &cur, sizeof (cur)); l->next = NULL; @@ -926,7 +922,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f) break; } htclfile = html_quote_string (f->name); - fprintf (fp, "host, u->port); + fprintf (fp, "host, u->port); if (*u->dir != '/') putc ('/', fp); fprintf (fp, "%s", u->dir); @@ -940,7 +936,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f) putc ('/', fp); fprintf (fp, " "); if (f->type == FT_PLAINFILE) - fprintf (fp, _(" (%s bytes)"), with_thousand_seps (f->size)); + fprintf (fp, _(" (%s bytes)"), number_to_static_string (f->size)); else if (f->type == FT_SYMLINK) fprintf (fp, "-> %s", f->linkto ? f->linkto : "(nil)"); putc ('\n', fp);