Use new function flac_snprintf() where ever appropriate.
[platform/upstream/flac.git] / src / plugin_xmms / http.c
index 5586ce2..c51f1b8 100644 (file)
@@ -17,9 +17,7 @@
  */
 /* modified for FLAC support by Steven Richman (2003) */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "plugin.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -34,6 +32,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <pthread.h>
 
@@ -43,7 +42,6 @@
 #include "FLAC/format.h"
 #include "configure.h"
 #include "locale_hack.h"
-#include "plugin.h"
 
 /* on FreeBSD we get socklen_t from <sys/socket.h> */
 #if (!defined HAVE_SOCKLEN_T) && !defined(__FreeBSD__)
@@ -456,7 +454,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
                                {
                                        udp_port = udp_establish_listener (&udp_sock);
                                        if (udp_port > 0)
-                                               sprintf (udpspace, "x-audiocast-udpport: %d\r\n", udp_port);
+                                               flac_snprintf (udpspace, sizeof (udpspace), "x-audiocast-udpport: %d\r\n", udp_port);
                                        else
                                                udp_sock = 0;
                                }
@@ -881,7 +879,7 @@ static int udp_check_for_data(int sock)
                else if (strstr(lines[i], "x-audiocast-udpseqnr:") != NULL)
                {
                        gchar obuf[60];
-                       sprintf(obuf, "x-audiocast-ack: %ld \r\n", atol(valptr));
+                       flac_snprintf(obuf, sizeof (obuf), "x-audiocast-ack: %ld \r\n", atol(valptr));
                        if (sendto(sock, obuf, strlen(obuf), 0, (struct sockaddr *) &from, fromlen) < 0)
                        {
                                g_log(NULL, G_LOG_LEVEL_WARNING,