More checks

This commit is contained in:
Lailouezzz 2020-01-05 17:29:53 +01:00
parent 88b6bfd1a2
commit 84fc38dc35
Signed by: Lailouezzz
GPG Key ID: 03FCE8A99EF8482C
2 changed files with 11 additions and 2 deletions

View File

@ -187,8 +187,12 @@ int CASIO_EXPORT casio_sevenfs_open(sevenfs_cookie_t *cookie, sevenfs_path_t *pa
casio_off_t size, casio_openmode_t mode, casio_stream_t **stream)
{
casio_link_t *handle = cookie; int err;
const char *dirname = &path->sevenfs_path_data[path->sevenfs_path_dir];
const char *filename = &path->sevenfs_path_data[path->sevenfs_path_file];
const char *dirname = path->sevenfs_path_dir != 0xFF ?
&path->sevenfs_path_data[path->sevenfs_path_dir] :
NULL;
const char *filename = path->sevenfs_path_file != 0xFF ?
&path->sevenfs_path_data[path->sevenfs_path_file] :
NULL;
const char *devname = &path->sevenfs_path_data[path->sevenfs_path_dev];
/* Make checks (not really required) */

View File

@ -65,6 +65,11 @@
# define chk_dirname(CASIO__DN) /* TODO */
/* Check that the directory name is there and ok. */
# define chk_required_dirname(CASIO__DN) \
if (!(CASIO_DN)) return (casio_error_invalid);
/* Check that the MCS request head is ok. */
# define chk_head(CASIO__HD) \