[vsipl++] Matlab IO Patch
Mark Mitchell
mark at codesourcery.com
Tue May 30 20:25:14 UTC 2006
Jules Bergmann wrote:
>> + int length = m_view.array_name_header.size;
>> + char c;
>> + char c_array[128];
>
> How is 128 chosen? Is that specified as the maximum size in the Matlab
> file spec? If so, an assertion would be in order 'assert(length <
> 128)'. (Strict less-than since we put a \0 at the end).
I think this should be an exception. One should never trust an external
data format to be correct; the file might be corrupt, etc. One should
only use assertions for things that will always be true unless the
system (hardware, compiler, OS) or the program itself are broken. Never
trust users or programs you didn't write.
--
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713
More information about the vsipl++
mailing list