network.c
branchtrunk
changeset 29 640ce9201139
parent 22 93aaf15c145a
     1.1 --- a/network.c	Mon Aug 17 20:55:55 2009 +0800
     1.2 +++ b/network.c	Mon Aug 17 20:56:48 2009 +0800
     1.3 @@ -38,6 +38,7 @@
     1.4  #include "common.h"
     1.5  #include "setup-mp3.h"
     1.6  #include "network.h"
     1.7 +#include "data.h"
     1.8  
     1.9  #define CON_TIMEOUT      30*1000   // default timeout (ms) for connect operation
    1.10  #define RW_TIMEOUT       30*1000   // default timeout (ms) for read/write operations
    1.11 @@ -53,10 +54,9 @@
    1.12  {
    1.13    int res=-1;
    1.14    if(cmd) {
    1.15 -    char *tmp=0;
    1.16 -    if(Name)
    1.17 -      asprintf(&tmp,"%s %s \"%s\"",cmd,State,*strescape(Name,"\"$"));
    1.18 -    else asprintf(&tmp,"%s %s",cmd,State);
    1.19 +    char *tmp;
    1.20 +    if(Name) tmp=aprintf("%s %s \"%s\"",cmd,State,*strescape(Name,"\"$"));
    1.21 +    else     tmp=aprintf("%s %s",cmd,State);
    1.22  
    1.23      d(printf("run: executing '%s'\n",tmp))
    1.24      res=SystemExec(tmp);