From: Pekka Riikonen Date: Sat, 16 Aug 2003 09:01:45 +0000 (+0000) Subject: Not using
 anymore.
X-Git-Tag: silc.trunk.merged.silc.1.0.branch.2~7
X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=6ef5427c3fd2c56f1d390d0e0f9e9fa29e1762bd

	Not using 
 anymore.
	Fixed the URL href setting.
---

diff --git a/apps/silcmap/silcmap_html.c b/apps/silcmap/silcmap_html.c
index 27e279c5..d9fb3233 100644
--- a/apps/silcmap/silcmap_html.c
+++ b/apps/silcmap/silcmap_html.c
@@ -27,7 +27,8 @@ bool silc_map_writehtml(SilcMap map, SilcMapConnection mapconn)
 {
   FILE *fp;
   char *hostname;
-  char filename[256];
+  char filename[256], line[128];
+  int begin;
 
   /* Generate data filename.  First configure hostname is the filename */
   silc_dlist_start(mapconn->hostnames);
@@ -134,9 +135,9 @@ bool silc_map_writehtml(SilcMap map, SilcMapConnection mapconn)
       fprintf(fp, "Country : %s\n", ident->country);
     }
     fprintf(fp, "  ");
-    fprintf(fp, "Fingerprint (SHA1) : %s\n", fingerprint);
+    fprintf(fp, "Fingerprint (SHA1) : %s\n", fingerprint);
     fprintf(fp, "  ");
-    fprintf(fp, "Babbleprint (SHA1) : %s\n", babbleprint);
+    fprintf(fp, "Babbleprint (SHA1) : %s\n", babbleprint);
     fprintf(fp, "\n");
 
     pd = fopen(mapconn->public_key, "r");
@@ -144,14 +145,17 @@ bool silc_map_writehtml(SilcMap map, SilcMapConnection mapconn)
       return FALSE;
 
     pk_len = silc_file_size(mapconn->public_key);
-    pdd = silc_calloc(pk_len + 1, sizeof(*pdd));
+    pdd = silc_calloc(pk_len + 2, sizeof(*pdd));
     if (!pdd)
       return FALSE;
     fread(pdd, pk_len, 1, pd);
+    pdd[pk_len] = EOF;
 
-    fprintf(fp, "
\n");
-    fprintf(fp, "%s", pdd);
-    fprintf(fp, "
\n"); + fprintf(fp, "
\n"); + begin = 0; + while (silc_gets(line, sizeof(line) - 1, pdd, pk_len + 1, &begin) != EOF) + fprintf(fp, "%s
\n", line); + fprintf(fp, "

\n"); fclose(pd); silc_free(pdd); @@ -280,7 +284,13 @@ bool silc_map_writehtml(SilcMap map, SilcMapConnection mapconn) if (mapconn->motd) { fprintf(fp, " 


\n"); fprintf(fp, "Message of the Day: 
\n"); - fprintf(fp, "
%s
\n", mapconn->data.motd);
+
+    fprintf(fp, "
\n"); + begin = 0; + while (silc_gets(line, sizeof(line) - 1, mapconn->data.motd, + strlen(mapconn->data.motd), &begin) != EOF) + fprintf(fp, "%s
\n", line); + fprintf(fp, "
\n"); } fprintf(fp, "
\n"); @@ -328,16 +338,20 @@ bool silc_map_writehtml_index(SilcMap map) silc_dlist_start(mapconn->ips); ip = silc_dlist_get(mapconn->ips); + fprintf(fp, "\n"); + if (mapconn->html_url) + fprintf(fp, + " %s\n", class, mapconn->html_url, hostname); + else + fprintf(fp, + " %s\n", class, hostname, mapconn->port, hostname); fprintf(fp, - "\n" - " %s\n" " %s\n" " %d\n" " %s\n" " %s\n" - "\n", class, - mapconn->html_url ? mapconn->html_url : hostname, mapconn->port, - hostname, class, ip, class, mapconn->port, class, + "\n", + class, ip, class, mapconn->port, class, mapconn->country, class, mapconn->admin); }