aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/asn1/packet-asn1.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-07-25 13:50:00 +0200
committerGuy Harris <guy@alum.mit.edu>2014-07-25 21:26:01 +0000
commit0492921adc1d6e3978b93bcac35140510228a62a (patch)
treeb1a2314608c978c1788bdedfa329e4bea9fac6c1 /plugins/asn1/packet-asn1.c
parentc3e42cc6b4e21b0278e8bae5064ac1b99031f045 (diff)
Replace lseek/fstat by ws_lseek64/ws_fstat64
lseek returns an off_t type which is system-dependent. Use ws_lseek64 in favor of lseek as that supports 64-bit quanities. Use ws_fstat64 instead of stat to support 64-bit file sizes on Windows. For the majority of the changes, this makes no difference as they do not apply to Windows ("ifndef _WIN32"; availability of st_blksize). There are no other users of "struct stat" besides the portability code in wsutil. Forbid the use of fstat and lseek in checkAPIs. Change-Id: I17b930ab9543f21a9d3100f3795d250c9b9ae459 Reviewed-on: https://code.wireshark.org/review/3198 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'plugins/asn1/packet-asn1.c')
-rw-r--r--plugins/asn1/packet-asn1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/asn1/packet-asn1.c b/plugins/asn1/packet-asn1.c
index 12de099fe7..07bce98395 100644
--- a/plugins/asn1/packet-asn1.c
+++ b/plugins/asn1/packet-asn1.c
@@ -3148,7 +3148,7 @@ read_asn1_type_table(const char *filename)
int ret;
guint size = 0;
guchar *data;
- struct stat file_stat;
+ ws_statb64 file_stat;
static guint mylogh = 0;
if ((filename == 0) || (strlen(filename) == 0))
@@ -3170,7 +3170,7 @@ read_asn1_type_table(const char *filename)
report_open_failure(filename, errno, FALSE);
return;
}
- ret = fstat(fileno(f), &file_stat);
+ ret = ws_fstat64(fileno(f), &file_stat);
if (ret!=-1)
size = (int)file_stat.st_size;
if (size == 0) {