Revision: 9463 http://pure-data.svn.sourceforge.net/pure-data/?rev=9463&view=rev Author: zmoelnig Date: 2008-02-20 08:30:38 -0800 (Wed, 20 Feb 2008)
Log Message: ----------- better error messages
Modified Paths: -------------- trunk/externals/zexy/src/msgfile.c
Modified: trunk/externals/zexy/src/msgfile.c =================================================================== --- trunk/externals/zexy/src/msgfile.c 2008-02-20 16:27:24 UTC (rev 9462) +++ trunk/externals/zexy/src/msgfile.c 2008-02-20 16:30:38 UTC (rev 9463) @@ -592,13 +592,19 @@ break; }
- if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0,SEEK_SET) < 0 - || !(readbuf = t_getbytes(length))) { + if ((length = lseek(fd, 0, SEEK_END)) < 0 || lseek(fd, 0,SEEK_SET) < 0) { pd_error(x, "msgfile_read: unable to lseek %s", filnam); close(fd); return; }
+ if (!(readbuf = t_getbytes(length))) { + pd_error(x, "msgfile_read: could not reserve %d bytes to read into", length); + close(fd); + return; + } + + /* read */ if ((readlength = read(fd, readbuf, length)) < length) { pd_error(x, "msgfile_read: unable to read %s", filnam);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.