diff options
Diffstat (limited to 'source/blender/blenlib/intern/storage.c')
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index a6b91bf489d..1d46679cbf2 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -180,12 +180,15 @@ double BLI_diskfree(char *dir) return (double) (freec*bytesps*sectorspc); #else struct statfs disk; - char name[100],*slash; - - + char name[FILE_MAXDIR],*slash; + int len = strlen(dir); + + if (len >= FILE_MAXDIR) /* path too long */ + return -1; + strcpy(name,dir); - if(strlen(name)){ + if(len){ slash = strrchr(name,'/'); if (slash) slash[1] = 0; } else strcpy(name,"/"); |