summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <info@littlecms.com>2010-11-24 16:45:45 +0100
committerMarti Maria <info@littlecms.com>2010-11-24 16:45:45 +0100
commit9dab249d60caebed2ac530ab53fcb0231b218c2b (patch)
tree57ab940814c476c7f0347967ae4a4851d44456bb
parent3cb4dac6c35c30d05c35466cfdb31ffbee5a3e80 (diff)
downloadlcms2-9dab249d60caebed2ac530ab53fcb0231b218c2b.tar.gz
cmsfilelength now keeps position of stream
-rw-r--r--AUTHORS3
-rw-r--r--src/cmserr.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 5ffeafe..37c0e43 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -21,4 +21,5 @@ Special Thanks
--------------
Jan Morovic
Jos Vernon (WebSupergoo)
-Harald Schneider (Maxon) \ No newline at end of file
+Harald Schneider (Maxon)
+Christian Albrecht
diff --git a/src/cmserr.c b/src/cmserr.c
index 5f79328..55f0358 100644
--- a/src/cmserr.c
+++ b/src/cmserr.c
@@ -43,17 +43,21 @@ int CMSEXPORT cmsstrcasecmp(const char* s1, const char* s2)
// long int because C99 specifies ftell in such way (7.19.9.2)
long int CMSEXPORT cmsfilelength(FILE* f)
{
- long int n;
+ long int p , n;
+
+ p = ftell(f); // register current file position
if (fseek(f, 0, SEEK_END) != 0) {
return -1;
}
+
n = ftell(f);
- fseek(f, 0, SEEK_SET);
+ fseek(f, p, SEEK_SET); // file position restored
return n;
}
+
// Memory handling ------------------------------------------------------------------
//
// This is the interface to low-level memory management routines. By default a simple