blob: 9e30fe71f992c553380065c388bd00cc145415c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
$NetBSD: patch-am,v 1.1 2005/06/14 18:10:37 jlam Exp $
--- lib/RdFToBuf.c.orig 1998-03-19 14:51:00.000000000 -0500
+++ lib/RdFToBuf.c
@@ -37,6 +37,8 @@
* HeDu (hedu@cul-ipn.uni-kiel.de) 4/94
*/
+/* October 2004, source code review by Thomas Biege <thomas@suse.de> */
+
#include "XpmI.h"
#include <sys/stat.h>
#if !defined(FOR_MSW) && !defined(WIN32)
@@ -58,7 +60,8 @@ XpmReadFileToBuffer(filename, buffer_ret
char *filename;
char **buffer_return;
{
- int fd, fcheck, len;
+ int fd, fcheck;
+ off_t len;
char *ptr;
struct stat stats;
FILE *fp;
@@ -82,7 +85,7 @@ XpmReadFileToBuffer(filename, buffer_ret
close(fd);
return XpmOpenFailed;
}
- len = (int) stats.st_size;
+ len = stats.st_size;
ptr = (char *) XpmMalloc(len + 1);
if (!ptr) {
fclose(fp);
|