#endif
#ifndef lint
-FILE_RCSID("@(#)$Id: compress.c,v 1.27 2003/03/23 21:16:26 christos Exp $")
+FILE_RCSID("@(#)$Id: compress.c,v 1.28 2003/03/23 21:24:07 christos Exp $")
#endif
if (file_printf(ms, " (") == -1)
return -1;
ms->flags &= ~MAGIC_COMPRESS;
- (void)magic_buf(ms, buf, nbytes);
+ if (file_buf(ms, buf, nbytes) == -1) {
+ ms->flags |= MAGIC_COMPRESS;
+ return -1;
+ }
ms->flags |= MAGIC_COMPRESS;
if (file_printf(ms, ")") == -1)
return -1;
#include "patchlevel.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: magic.c,v 1.2 2003/03/23 21:16:26 christos Exp $")
+FILE_RCSID("@(#)$Id: magic.c,v 1.3 2003/03/23 21:24:07 christos Exp $")
#endif /* lint */
return NULL;
} else {
buf[nbytes++] = '\0'; /* null-terminate it */
- if (file_buf(ms, buf, nbytes) == -1)
+ if (file_buffer(ms, buf, nbytes) == -1)
return NULL;
#ifdef BUILTIN_ELF
if (nbytes > 5) {
* The main work is done here!
* We have the file name and/or the data buffer to be identified.
*/
- if (file_buf(ms, buf, nb) == -1) {
+ if (file_buffer(ms, buf, nb) == -1) {
return NULL;
}
return ms->haderr ? NULL : ms->o.buf;
void magic_close(magic_t);
const char *magic_file(magic_t, const char *);
-const char *magic_buf(magic_t, const void *, size_t);
+const char *magic_buffer(magic_t, const void *, size_t);
const char *magic_error(magic_t);
void magic_setflags(magic_t, int);