diff options
author | Christos Zoulas <christos@zoulas.com> | 2017-11-02 20:25:39 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2017-11-02 20:25:39 +0000 |
commit | 18726eb5fd61c19f6ba82aefeead820568dededd (patch) | |
tree | 470ecbf65ea84251948255a911418e9ceb964420 /src/readcdf.c | |
parent | 19f35b93a3d34c8b21027d3f953289338727c406 (diff) | |
download | file-git-18726eb5fd61c19f6ba82aefeead820568dededd.tar.gz |
- Encapsulate the buffer, size and file descriptor in a struct buffer.
- Prepare for signed offset (negative offsets will be relative to the end
of file).
- Fix name collision for file_err().
- fix file_encoding to not return a unicode buffer if NULL is passed.
Diffstat (limited to 'src/readcdf.c')
-rw-r--r-- | src/readcdf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/readcdf.c b/src/readcdf.c index 80c8d26e..51b862cf 100644 --- a/src/readcdf.c +++ b/src/readcdf.c @@ -26,7 +26,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readcdf.c,v 1.65 2017/04/08 20:58:03 christos Exp $") +FILE_RCSID("@(#)$File: readcdf.c,v 1.66 2017/11/02 20:25:39 christos Exp $") #endif #include <assert.h> @@ -537,9 +537,11 @@ cdf_file_dir_info(struct magic_set *ms, const cdf_dir_t *dir) } protected int -file_trycdf(struct magic_set *ms, int fd, const unsigned char *buf, - size_t nbytes) +file_trycdf(struct magic_set *ms, const struct buffer *b) { + int fd = b->fd; + const unsigned char *buf = b->fbuf; + size_t nbytes = b->flen; cdf_info_t info; cdf_header_t h; cdf_sat_t sat, ssat; |