]> sjero.net Git - wget/blobdiff - src/ftp-ls.c
[svn] Extract timers to a separate file.
[wget] / src / ftp-ls.c
index d2dde2ec5f5858e19a869617ca5e264010f8ba43..dd703dfd193d9e3773fd8745959028de9b2d8554 100644 (file)
@@ -47,6 +47,7 @@ so, delete this exception statement from your version.  */
 #include "utils.h"
 #include "ftp.h"
 #include "url.h"
+#include "convert.h"           /* for html_quote_string prototype */
 
 extern FILE *output_stream;
 
@@ -872,9 +873,10 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
 
       tmpu = url_escape (u->user);
       tmpp = u->passwd ? url_escape (u->passwd) : NULL;
-      upwd = (char *)xmalloc (strlen (tmpu)
-                            + (tmpp ? (1 + strlen (tmpp)) : 0) + 2);
-      sprintf (upwd, "%s%s%s@", tmpu, tmpp ? ":" : "", tmpp ? tmpp : "");
+      if (tmpp)
+       upwd = concat_strings (tmpu, ":", tmpp, "@", (char *) 0);
+      else
+       upwd = concat_strings (tmpu, "@", (char *) 0);
       xfree (tmpu);
       xfree_null (tmpp);
     }
@@ -938,7 +940,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
        putc ('/', fp);
       fprintf (fp, "</a> ");
       if (f->type == FT_PLAINFILE)
-       fprintf (fp, _(" (%s bytes)"), legible (f->size));
+       fprintf (fp, _(" (%s bytes)"), with_thousand_seps (f->size));
       else if (f->type == FT_SYMLINK)
        fprintf (fp, "-> %s", f->linkto ? f->linkto : "(nil)");
       putc ('\n', fp);