diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-09-21 22:25:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-09-21 22:25:40 +0400 |
commit | d82f1f5f91a8d1b19f1451479e1e82ab15744356 (patch) | |
tree | a3f11e1127449c818146bf38167c5f97cc8e10b5 /source/blender/python/api2_2x/Image.c | |
parent | 95c185c4c5be57fb0c83b1045605ca8ac37e5284 (diff) |
from looking at patch 4934 made all user preference paths settable with Blender.Set('val', data), also added exception errors which were on the todo.
image.filename was being limited to FILE_MAXDIR rather then FILE_MAXDIR + FILE_MAXFILE when setting.
Diffstat (limited to 'source/blender/python/api2_2x/Image.c')
-rw-r--r-- | source/blender/python/api2_2x/Image.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c index b280fd83931..bd3c76c1ee5 100644 --- a/source/blender/python/api2_2x/Image.c +++ b/source/blender/python/api2_2x/Image.c @@ -1036,17 +1036,17 @@ static PyObject *Image_setFilename( BPy_Image * self, PyObject * args ) char *name; int namelen = 0; - /* max len is FILE_MAXDIR = 160 chars like done in DNA_image_types.h */ + /* max len is FILE_MAXDIR == 160, FILE_MAXFILE == 80 chars like done in DNA_image_types.h */ if( !PyArg_ParseTuple( args, "s#", &name, &namelen ) ) return ( EXPP_ReturnPyObjError( PyExc_TypeError, "expected a string argument" ) ); - if( namelen >= FILE_MAXDIR ) + if( namelen >= FILE_MAXDIR + FILE_MAXFILE ) return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "string argument is limited to 160 chars at most" ) ); + "string argument is limited to 240 chars at most" ) ); - PyOS_snprintf( self->image->name, FILE_MAXDIR * sizeof( char ), "%s", + PyOS_snprintf( self->image->name, (FILE_MAXDIR + FILE_MAXFILE) * sizeof( char ), "%s", name ); Py_RETURN_NONE; |