Commit 018d0a27 authored by Michael Smith's avatar Michael Smith
Browse files

Fix lots of warnings in new admin stuff - primarily wrong types in printf

format strings.

svn path=/trunk/icecast/; revision=4830
parent 60bce31e
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "event.h" #include "event.h"
#include "stats.h" #include "stats.h"
#include "os.h" #include "os.h"
#include "xslt.h"
#include "format.h" #include "format.h"
#include "format_mp3.h" #include "format_mp3.h"
...@@ -145,7 +146,6 @@ xmlDocPtr admin_build_sourcelist(char *current_source) ...@@ -145,7 +146,6 @@ xmlDocPtr admin_build_sourcelist(char *current_source)
xmlNodePtr xmlnode, srcnode; xmlNodePtr xmlnode, srcnode;
xmlDocPtr doc; xmlDocPtr doc;
char buf[22]; char buf[22];
int len = 0;
time_t now = time(NULL); time_t now = time(NULL);
doc = xmlNewDoc("1.0"); doc = xmlNewDoc("1.0");
...@@ -168,10 +168,10 @@ xmlDocPtr admin_build_sourcelist(char *current_source) ...@@ -168,10 +168,10 @@ xmlDocPtr admin_build_sourcelist(char *current_source)
(source->fallback_mount != NULL)? (source->fallback_mount != NULL)?
source->fallback_mount:""); source->fallback_mount:"");
memset(buf, '\000', sizeof(buf)); memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%d", source->listeners); snprintf(buf, sizeof(buf)-1, "%ld", source->listeners);
xmlNewChild(srcnode, NULL, "listeners", buf); xmlNewChild(srcnode, NULL, "listeners", buf);
memset(buf, '\000', sizeof(buf)); memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%d", now - source->con->con_time); snprintf(buf, sizeof(buf)-1, "%ld", now - source->con->con_time);
xmlNewChild(srcnode, NULL, "Connected", buf); xmlNewChild(srcnode, NULL, "Connected", buf);
xmlNewChild(srcnode, NULL, "Format", xmlNewChild(srcnode, NULL, "Format",
source->format->format_description); source->format->format_description);
...@@ -387,20 +387,6 @@ static void html_success(client_t *client, char *message) ...@@ -387,20 +387,6 @@ static void html_success(client_t *client, char *message)
client_destroy(client); client_destroy(client);
} }
static void html_head(client_t *client)
{
int bytes;
client->respcode = 200;
bytes = sock_write(client->con->sock,
"HTTP/1.0 200 OK\r\n"
"Content-Type: text/html\r\n"
"\r\n"
"<html><head><title>Admin request</title></head>"
"<body>");
if(bytes > 0) client->con->sent_bytes = bytes;
}
static void html_write(client_t *client, char *fmt, ...) static void html_write(client_t *client, char *fmt, ...)
{ {
int bytes; int bytes;
...@@ -425,7 +411,7 @@ static void command_move_clients(client_t *client, source_t *source, ...@@ -425,7 +411,7 @@ static void command_move_clients(client_t *client, source_t *source,
int parameters_passed = 0; int parameters_passed = 0;
DEBUG0("Doing optional check"); DEBUG0("Doing optional check");
if (COMMAND_OPTIONAL(client, "destination", dest_source)) { if((COMMAND_OPTIONAL(client, "destination", dest_source))) {
parameters_passed = 1; parameters_passed = 1;
} }
DEBUG1("Done optional check (%d)", parameters_passed); DEBUG1("Done optional check (%d)", parameters_passed);
...@@ -488,7 +474,6 @@ static void command_show_listeners(client_t *client, source_t *source, ...@@ -488,7 +474,6 @@ static void command_show_listeners(client_t *client, source_t *source,
avl_node *client_node; avl_node *client_node;
client_t *current; client_t *current;
char buf[22]; char buf[22];
int len = 0;
char *userAgent = NULL; char *userAgent = NULL;
time_t now = time(NULL); time_t now = time(NULL);
...@@ -499,7 +484,7 @@ static void command_show_listeners(client_t *client, source_t *source, ...@@ -499,7 +484,7 @@ static void command_show_listeners(client_t *client, source_t *source,
xmlDocSetRootElement(doc, node); xmlDocSetRootElement(doc, node);
memset(buf, '\000', sizeof(buf)); memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%d", source->listeners); snprintf(buf, sizeof(buf)-1, "%ld", source->listeners);
xmlNewChild(srcnode, NULL, "Listeners", buf); xmlNewChild(srcnode, NULL, "Listeners", buf);
avl_tree_rlock(source->client_tree); avl_tree_rlock(source->client_tree);
...@@ -517,10 +502,10 @@ static void command_show_listeners(client_t *client, source_t *source, ...@@ -517,10 +502,10 @@ static void command_show_listeners(client_t *client, source_t *source,
xmlNewChild(listenernode, NULL, "UserAgent", "Unknown"); xmlNewChild(listenernode, NULL, "UserAgent", "Unknown");
} }
memset(buf, '\000', sizeof(buf)); memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%d", now - current->con->con_time); snprintf(buf, sizeof(buf)-1, "%ld", now - current->con->con_time);
xmlNewChild(listenernode, NULL, "Connected", buf); xmlNewChild(listenernode, NULL, "Connected", buf);
memset(buf, '\000', sizeof(buf)); memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%d", current->con->id); snprintf(buf, sizeof(buf)-1, "%lu", current->con->id);
xmlNewChild(listenernode, NULL, "ID", buf); xmlNewChild(listenernode, NULL, "ID", buf);
client_node = avl_get_next(client_node); client_node = avl_get_next(client_node);
} }
...@@ -664,14 +649,7 @@ static void command_stats(client_t *client, int response) { ...@@ -664,14 +649,7 @@ static void command_stats(client_t *client, int response) {
} }
static void command_list_mounts(client_t *client, int response) { static void command_list_mounts(client_t *client, int response) {
avl_node *node;
source_t *source;
int bytes;
xmlDocPtr doc; xmlDocPtr doc;
xmlNodePtr xmlnode, srcnode, datanode;
char buf[22];
int len = 0;
time_t now = time(NULL);
DEBUG0("List mounts request"); DEBUG0("List mounts request");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment