Merged with recent changes from trunk.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11187 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Maciej Drwal 2009-04-11 16:46:47 +00:00
commit 8c74fa0f46
703 changed files with 21126 additions and 9266 deletions

View file

@ -132,7 +132,10 @@ int ColorMap_write(ColorMap *cm, char *filename) {
f = fopen(filename,"w");
fwrite(cm->cmap,768,1,f);
if (fwrite(cm->cmap,768,1,f) != 1) {
fclose(f);
return -1;
}
fclose(f);
return 0;
}

View file

@ -268,7 +268,7 @@ static int maxmaxcode = 1 << GP_BITS; /* NEVER generate this */
static count_int *htab;
static unsigned short *codetab;
static GIFOutBufSize;
static int GIFOutBufSize;
/* static count_int htab [HSIZE];
static unsigned short codetab [HSIZE]; */
@ -656,7 +656,11 @@ int FrameBuffer_writeGIF(FrameBuffer *f, ColorMap *c, char *filename) {
fclose(file);
return -1;
}
fwrite(buffer,nbytes,1,file);
if (fwrite(buffer,nbytes,1,file) != 1) {
free(buffer);
fclose(file);
return -1;
}
fclose(file);
free(buffer);
return 0;