[MPlayer-cvslog] r32603 - trunk/stream/network.c

cboesch subversion at mplayerhq.hu
Sun Nov 7 22:48:12 CET 2010


Author: cboesch
Date: Sun Nov  7 22:48:12 2010
New Revision: 32603

Log:
Replace hardcoded str size with sizeof

Modified:
   trunk/stream/network.c

Modified: trunk/stream/network.c
==============================================================================
--- trunk/stream/network.c	Sun Nov  7 22:42:26 2010	(r32602)
+++ trunk/stream/network.c	Sun Nov  7 22:48:12 2010	(r32603)
@@ -215,14 +215,14 @@ http_send_request( URL_t *url, off_t pos
 		http_set_uri( http_hdr, server_url->file );
 	}
 	if (server_url->port && server_url->port != 80)
-	    snprintf(str, 256, "Host: %s:%d", server_url->hostname, server_url->port );
+	    snprintf(str, sizeof(str), "Host: %s:%d", server_url->hostname, server_url->port );
 	else
-	    snprintf(str, 256, "Host: %s", server_url->hostname );
+	    snprintf(str, sizeof(str), "Host: %s", server_url->hostname );
 	http_set_field( http_hdr, str);
 	if (network_useragent)
-	    snprintf(str, 256, "User-Agent: %s", network_useragent);
+	    snprintf(str, sizeof(str), "User-Agent: %s", network_useragent);
 	else
-	    snprintf(str, 256, "User-Agent: %s", mplayer_version);
+	    snprintf(str, sizeof(str), "User-Agent: %s", mplayer_version);
         http_set_field(http_hdr, str);
 
 	if (network_referrer) {
@@ -247,7 +247,7 @@ http_send_request( URL_t *url, off_t pos
 
 	if(pos>0) {
 	// Extend http_send_request with possibility to do partial content retrieval
-	    snprintf(str, 256, "Range: bytes=%"PRId64"-", (int64_t)pos);
+	    snprintf(str, sizeof(str), "Range: bytes=%"PRId64"-", (int64_t)pos);
 	    http_set_field(http_hdr, str);
 	}
 


More information about the MPlayer-cvslog mailing list