fix:
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 2 Jul 2013 11:19:13 +0000 (11:19 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 2 Jul 2013 11:19:13 +0000 (11:19 +0000)
- empty string if no url given
- print port as short

src/transport/plugin_transport_http_server.c

index a332804ef1c43fbae4825e7860b34c758f67afe8..8f4b5bbeb897999d747a65151485c9ed5bc22eba 100644 (file)
@@ -2793,10 +2793,10 @@ server_configure_plugin (struct HTTP_Server_Plugin *plugin)
         {
                pos_url = pos + 1;
                pos[0] = '\0';
-               GNUNET_asprintf (&plugin->external_hostname, "%s:%u/%s", tmp, port, pos_url);
+               GNUNET_asprintf (&plugin->external_hostname, "%s:%u/%s", tmp, (uint16_t) port, (NULL == pos_url) ? "" : pos_url);
         }
         else
-               GNUNET_asprintf (&plugin->external_hostname, "%s:%u", tmp, port);
+               GNUNET_asprintf (&plugin->external_hostname, "%s:%u", tmp, (uint16_t) port);
       }
       else
        plugin->external_hostname = GNUNET_strdup (tmp);