Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Mein <mein@cs.umn.edu>2005-11-22 23:24:28 +0300
committerKent Mein <mein@cs.umn.edu>2005-11-22 23:24:28 +0300
commitd234f611f51aef0fff38634e0581727513d62359 (patch)
tree9c8c00c6e16683eb5251f2c3dff09e59bf76c4d5 /source/blender/imbuf
parent9664b7924fd8a0bc06b8d424e3e9f35c2ca6cf6e (diff)
got rid of snprintf.... Replaced with MEM_mallocN and friends...
Kent
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/dynlibtiff.c17
-rwxr-xr-xsource/blender/imbuf/intern/gen_dynlibtiff.py17
2 files changed, 28 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/dynlibtiff.c b/source/blender/imbuf/intern/dynlibtiff.c
index aed73d29fcb..553449cf159 100644
--- a/source/blender/imbuf/intern/dynlibtiff.c
+++ b/source/blender/imbuf/intern/dynlibtiff.c
@@ -48,11 +48,16 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+
+#include "BLI_blenlib.h"
+
+#include "imbuf.h"
+#include "imbuf_patch.h"
#include "IMB_imbuf.h"
+
#include "BKE_global.h"
#include "PIL_dynlib.h"
-
/*********************
* LOCAL DEFINITIONS *
*********************/
@@ -68,8 +73,9 @@ int libtiff_load_symbols();
void libtiff_loadlibtiff()
{
- char filename[1024];
+ char *filename;
libtiff = NULL;
+ int size;
/* Try to find libtiff in a couple of standard places */
libtiff = PIL_dynlib_open("libtiff.so");
@@ -86,8 +92,13 @@ void libtiff_loadlibtiff()
/* For solaris */
libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so");
if (libtiff != NULL) return;
- snprintf(filename, 1023, "%s", getenv("BF_TIFF_LIB"));
+
+ size = sizeof(getenv("BF_TIFF_LIB"));
+
+ filename = MEM_mallocN(size * sizeof(unsigned char),"ENVVAR");
+ memcpy(filename,getenv("BF_TIFF_LIB"),size);
libtiff = PIL_dynlib_open(filename);
+ MEM_freeN(filename);
if (libtiff != NULL) return;
}
diff --git a/source/blender/imbuf/intern/gen_dynlibtiff.py b/source/blender/imbuf/intern/gen_dynlibtiff.py
index cb24ee9431b..fd58645eb6d 100755
--- a/source/blender/imbuf/intern/gen_dynlibtiff.py
+++ b/source/blender/imbuf/intern/gen_dynlibtiff.py
@@ -90,11 +90,16 @@ C_EXTRA = \
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+
+#include "BLI_blenlib.h"
+
+#include "imbuf.h"
+#include "imbuf_patch.h"
#include "IMB_imbuf.h"
+
#include "BKE_global.h"
#include "PIL_dynlib.h"
-
/*********************
* LOCAL DEFINITIONS *
*********************/
@@ -110,8 +115,9 @@ int libtiff_load_symbols();
void libtiff_loadlibtiff()
{
- char filename[1024];
+ char *filename;
libtiff = NULL;
+ int size;
/* Try to find libtiff in a couple of standard places */
libtiff = PIL_dynlib_open("libtiff.so");
@@ -128,8 +134,13 @@ void libtiff_loadlibtiff()
/* For solaris */
libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so");
if (libtiff != NULL) return;
- snprintf(filename, 1023, "%s", getenv("BF_TIFF_LIB"));
+
+ size = sizeof(getenv("BF_TIFF_LIB"));
+
+ filename = MEM_mallocN(size * sizeof(unsigned char),"ENVVAR");
+ memcpy(filename,getenv("BF_TIFF_LIB"),size);
libtiff = PIL_dynlib_open(filename);
+ MEM_freeN(filename);
if (libtiff != NULL) return;
}