diff --git a/src/fs/file.c b/src/fs/file.c index e69ba65..91d2a07 100644 --- a/src/fs/file.c +++ b/src/fs/file.c @@ -506,7 +506,7 @@ int meta_add(uint16_t fid, const uint8_t *data, uint16_t len) { return PICOKEY_OK; } -bool file_has_data(file_t *f) { +bool file_has_data(const file_t *f) { return f != NULL && f->data != NULL && file_get_size(f) > 0; } diff --git a/src/fs/file.h b/src/fs/file.h index 1cb605d..4512f33 100644 --- a/src/fs/file.h +++ b/src/fs/file.h @@ -100,7 +100,7 @@ __attribute__ ((packed)) #endif file_t; -extern bool file_has_data(file_t *); +extern bool file_has_data(const file_t *); extern file_t *currentEF; extern file_t *currentDF;