nshlib: Correct an error message

This commit is contained in:
Gregory Nutt 2015-11-28 11:57:37 -06:00
parent 88d3ac1c92
commit 64c7e31896

View File

@ -189,8 +189,9 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
* Name: nsh_readfile * Name: nsh_readfile
* *
* Description: * Description:
* Read a small file into a buffer buffer. An error occurs if the file * Read a small file into a user-provided buffer. The data is assumed to
* will not fit into the buffer. * be a string and is guaranteed to be NUL-termined. An error occurs if
* the file content (+terminator) will not fit into the provided 'buffer'.
* *
* Input Paramters: * Input Paramters:
* vtbl - The console vtable * vtbl - The console vtable
@ -318,12 +319,11 @@ int nsh_foreach_direntry(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
/* Open the directory */ /* Open the directory */
dirp = opendir(dirpath); dirp = opendir(dirpath);
if (dirp == NULL)
if (!dirp)
{ {
/* Failed to open the directory */ /* Failed to open the directory */
nsh_output(vtbl, g_fmtnosuch, cmd, "opendir", dirpath); nsh_output(vtbl, g_fmtnosuch, cmd, "directory", dirpath);
return ERROR; return ERROR;
} }
@ -332,7 +332,7 @@ int nsh_foreach_direntry(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
for (; ; ) for (; ; )
{ {
FAR struct dirent *entryp = readdir(dirp); FAR struct dirent *entryp = readdir(dirp);
if (!entryp) if (entryp == NULL)
{ {
/* Finished with this directory */ /* Finished with this directory */