summaryrefslogtreecommitdiff
path: root/src/htslib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/htslib.h')
-rw-r--r--src/htslib.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/htslib.h b/src/htslib.h
index 30bd2f4..d56b379 100644
--- a/src/htslib.h
+++ b/src/htslib.h
@@ -612,6 +612,14 @@ HTS_STATIC int compare_mime(httrackp * opt, const char *mime, const char *file,
#endif
+// returns (size_t) -1 upon error
+static size_t off_t_to_size_t(off_t o) {
+ if (o >= 0 && o < ( (size_t) -1 ) / 2) {
+ } else {
+ return (size_t) -1;
+ }
+}
+
/* dirent() compatibility */
#ifdef _WIN32
#define HTS_DIRENT_SIZE 256