Skip to content

various fixes #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fsutils/inifile/inifile.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ INIHANDLE inifile_initialize(FAR const char *inifile_name)
else
{
inidbg("ERROR: Could not open \"%s\"\n", inifile_name);
free(priv);
return (INIHANDLE)NULL;
}
}
Expand Down
1 change: 1 addition & 0 deletions fsutils/mksmartfs/mksmartfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ int mksmartfs(FAR const char *pathname, uint16_t sectorsize)
fd = open(pathname, O_RDWR);
if (fd < 0)
{
ret = -ENOENT;
goto errout;
}

Expand Down
8 changes: 8 additions & 0 deletions nshlib/nsh_fscmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,14 @@ int cmd_cp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
}
}

/* Check if the destination does not match the source */

if (strcmp(destpath, srcpath) == 0)
{
nsh_error(vtbl, g_fmtsyntax, argv[0]);
goto errout_with_allocpath;
}

/* Now open the destination */

wrfd = open(destpath, oflags, 0666);
Expand Down
7 changes: 5 additions & 2 deletions system/usbmsc/usbmsc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static void usbmsc_disconnect(FAR void *handle)
int main(int argc, FAR char *argv[])
{
struct boardioc_usbdev_ctrl_s ctrl;
FAR void *handle;
FAR void *handle = NULL;
int ret;

/* If this program is implemented as the NSH 'msconn' command, then we
Expand Down Expand Up @@ -495,7 +495,10 @@ int main(int argc, FAR char *argv[])
if (ret < 0)
{
printf("mcsonn_main: usbmsc_configure failed: %d\n", -ret);
usbmsc_disconnect(handle);
if (handle)
{
usbmsc_disconnect(handle);
}
return EXIT_FAILURE;
}

Expand Down
2 changes: 1 addition & 1 deletion system/zmodem/zm_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ static int zms_zrinit(FAR struct zm_state_s *pzm)
else
# endif
{
zmdbg("ZMS_STATE %d->%d\n", pzm->state, );
zmdbg("ZMS_STATE %d->%d\n", pzm->state, ZMS_DONE);
pzm->state = ZMS_DONE;
return ZM_XFRDONE;
}
Expand Down