bugfix
This commit is contained in:
@ -411,14 +411,14 @@ static int printObjectPar(SConnection *pCon,SicsInterp *pSics, char *obj){
|
|||||||
SCWrite(pCon,"ERROR: failed to open tmpfile",eError);
|
SCWrite(pCon,"ERROR: failed to open tmpfile",eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
buffer = (char *)malloc(length*sizeof(char));
|
buffer = malloc(length+1);
|
||||||
if(buffer == NULL){
|
if(buffer == NULL){
|
||||||
SCWrite(pCon,"ERROR: out of memory in list par",eError);
|
SCWrite(pCon,"ERROR: out of memory in list par",eError);
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
unlink(tmpfile);
|
unlink(tmpfile);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
memset(buffer,0,length*sizeof(char));
|
memset(buffer,0,length+1);
|
||||||
fread(buffer,length,1,fd);
|
fread(buffer,length,1,fd);
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
SCWrite(pCon,buffer,eValue);
|
SCWrite(pCon,buffer,eValue);
|
||||||
|
Reference in New Issue
Block a user