summary refs log tree commit diff stats
path: root/plugins/mpcinfo/functions.c
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2014-12-28 06:08:20 -0500
committerTingPing <tingping@tingping.se>2014-12-28 06:47:07 -0500
commit3f855f07f5d2e9a08a586436719358c40a46f29d (patch)
tree12ffd1b49265e33c10149632a4cd17afb7fe994a /plugins/mpcinfo/functions.c
parent83032b1aa3c3e5910c5cfd3e0ea1d25827f56475 (diff)
Use glib for allocations in all plugins
Continuation of 83032b1aa
Diffstat (limited to 'plugins/mpcinfo/functions.c')
-rw-r--r--plugins/mpcinfo/functions.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mpcinfo/functions.c b/plugins/mpcinfo/functions.c
index de2e8a40..e5993948 100644
--- a/plugins/mpcinfo/functions.c
+++ b/plugins/mpcinfo/functions.c
@@ -14,6 +14,8 @@
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <glib.h>
+
 char *split(char *text, char separator)
 {
 	int pos = -1;
@@ -67,7 +69,7 @@ int inStr(char *s1, size_t sl1, char *s2)
 
 static char *subString(char *text, int first, int length, int spcKill){
 //if (DEBUG==1) putlog("creating substring");
-	char *ret=(char*) calloc (length+1,sizeof(char)); //malloc(sizeof(char)*(length+1));
+	char *ret = g_new (char, length + 1);
 	int i;
 	ret[length]=0;
 	for (i=0;i<length;i++){
@@ -89,7 +91,7 @@ static char *substring(char *text, int first, int length){return subString(text,
 
 char *readLine(FILE *f){
      //if (DEBUG==1) putlog("reading line from file");
-     char *buffer=(char*)calloc(1024,sizeof(char)); //malloc(sizeof(char)*1024);
+     char *buffer = g_new (char, 1024);
      int pos=0;
      int cc=0;
      while((cc!=EOF)&&(pos<1024)&&(cc!=10)){