summaryrefslogtreecommitdiff
path: root/audio/mpg123/patches/patch-aq
blob: 311269f68b739e07a6db5487d395bf934604e1a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-aq,v 1.1 2004/02/10 09:32:47 tron Exp $

--- httpget.c.orig	Tue Feb 10 10:14:29 2004
+++ httpget.c	Tue Feb 10 10:18:07 2004
@@ -55,11 +55,10 @@
 #endif
 	int pos = 0;
 
-	while(1) {
+	while(pos < (maxlen - 1)) {
 		if( read(fileno(f),string+pos,1) == 1) {
 			pos++;
 			if(string[pos-1] == '\n') {
-				string[pos] = 0;
 				break;
 			}
 		}
@@ -78,6 +77,7 @@
 	}
 #endif
 
+	string[pos] = '\0';
 }
 
 void encode64 (char *source,char *destination)