This commit is contained in:
2019-03-31 20:52:06 +01:00
parent b255303607
commit 701bc2cedc
16 changed files with 1276 additions and 1349 deletions

View File

@@ -30,9 +30,9 @@
// Copyright © 2011-2019 Natalia Portillo
// ****************************************************************************/
#include <dicformat.h>
#include <errno.h>
#include <stdio.h>
#include <dicformat.h>
//! Identifies a file as dicformat, using path
/*!
@@ -47,8 +47,7 @@ int identify(const char *filename)
stream = fopen(filename, "rb");
if(stream == NULL)
return errno;
if(stream == NULL) return errno;
int ret = identifyStream(stream);
@@ -72,11 +71,9 @@ int identifyStream(FILE *imageStream)
size_t ret = fread(&header, sizeof(DicHeader), 1, imageStream);
if(ret < sizeof(DicHeader))
return 0;
if(ret < sizeof(DicHeader)) return 0;
if(header.identifier == DIC_MAGIC && header.imageMajorVersion <= DICF_VERSION)
return 100;
if(header.identifier == DIC_MAGIC && header.imageMajorVersion <= DICF_VERSION) return 100;
return 0;
}