1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-06 09:26:44 +02:00

Some misc fixes

This commit is contained in:
jfreegman
2020-02-29 14:14:56 -05:00
parent b080236ee5
commit 437dd8baeb
7 changed files with 18 additions and 10 deletions

View File

@ -491,7 +491,10 @@ bool file_exists(const char *path)
File_Type file_type(const char *path)
{
struct stat s;
stat(path, &s);
if (stat(path, &s) == -1) {
return FILE_TYPE_OTHER;
}
switch (s.st_mode & S_IFMT) {
case S_IFDIR:
@ -521,7 +524,7 @@ off_t file_size(const char *path)
Returns 0 if they are the same, 1 if they differ, and -1 on error.
On success this function will seek back to the beginning of fp */
int check_file_signature(const char *signature, size_t size, FILE *fp)
int check_file_signature(const unsigned char *signature, size_t size, FILE *fp)
{
char buf[size];