summaryrefslogtreecommitdiff
blob: ed869b160de043e97a095589f1096b82069a1008 (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
26
27
28
29
30
31
32
33
34
35
36
Fix MikMod_InfoLoader() and MikMod_InfoDriver() functions, fixing mikmod -n output.

diff -ur libmikmod-3.2.0-beta2.orig/playercode/mdriver.c libmikmod-3.2.0-beta2/playercode/mdriver.c
--- libmikmod-3.2.0-beta2.orig/playercode/mdriver.c	2004-02-18 15:29:19.000000000 +0200
+++ libmikmod-3.2.0-beta2/playercode/mdriver.c	2009-07-23 20:40:26.000000000 +0300
@@ -185,11 +185,12 @@
 
 	if(len)
 		if((list=_mm_malloc(len*sizeof(CHAR)))) {
+			char *_list = list;
 			list[0]=0;
 			/* list all registered device drivers : */
 			for(t=1,l=firstdriver;l;l=l->next,t++)
-				sprintf(list,(l->next)?"%s%2d %s\n":"%s%2d %s",
-				    list,t,l->Version);
+				_list += sprintf(_list,(l->next)?"%2d %s\n":"%2d %s",
+						 t,l->Version);
 		}
 	MUTEX_UNLOCK(lists);
 	return list;
diff -ur libmikmod-3.2.0-beta2.orig/playercode/mloader.c libmikmod-3.2.0-beta2/playercode/mloader.c
--- libmikmod-3.2.0-beta2.orig/playercode/mloader.c	2004-01-21 03:36:35.000000000 +0200
+++ libmikmod-3.2.0-beta2/playercode/mloader.c	2009-07-23 20:40:26.000000000 +0300
@@ -67,10 +67,11 @@
 
 	if(len)
 		if((list=_mm_malloc(len*sizeof(CHAR)))) {
+			char *_list = list;
 			list[0]=0;
 			/* list all registered module loders */
 			for(l=firstloader;l;l=l->next)
-				sprintf(list,(l->next)?"%s%s\n":"%s%s",list,l->version);
+				_list += sprintf(_list,(l->next)?"%s\n":"%s",l->version);
 		}
 	MUTEX_UNLOCK(lists);
 	return list;