mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-16 14:08:46 +08:00
Fixes in asprintf usage.
This commit is contained in:

committed by
Xiang Xiao

parent
cf54069487
commit
c50ff7ff61
@@ -121,7 +121,6 @@ static int stkmon_process_directory(FAR struct dirent *entryp)
|
||||
FILE *stream;
|
||||
unsigned long stack_size;
|
||||
unsigned long stack_used;
|
||||
int errcode;
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
@@ -134,13 +133,11 @@ static int stkmon_process_directory(FAR struct dirent *entryp)
|
||||
ret = asprintf(&filepath,
|
||||
CONFIG_SYSTEM_STACKMONITOR_MOUNTPOINT "/%s/status",
|
||||
entryp->d_name);
|
||||
if (ret < 0 || filepath == NULL)
|
||||
if (ret < 0)
|
||||
{
|
||||
errcode = errno;
|
||||
fprintf(stderr,
|
||||
"Stack Monitor: Failed to create path to status file: %d\n",
|
||||
errcode);
|
||||
return -errcode;
|
||||
"Stack Monitor: Failed to create path to status file\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Open the status file */
|
||||
@@ -189,12 +186,10 @@ static int stkmon_process_directory(FAR struct dirent *entryp)
|
||||
ret = asprintf(&filepath,
|
||||
CONFIG_SYSTEM_STACKMONITOR_MOUNTPOINT "/%s/stack",
|
||||
entryp->d_name);
|
||||
if (ret < 0 || filepath == NULL)
|
||||
if (ret < 0)
|
||||
{
|
||||
errcode = errno;
|
||||
fprintf(stderr,
|
||||
"Stack Monitor: Failed to create path to stack file: %d\n",
|
||||
errcode);
|
||||
"Stack Monitor: Failed to create path to stack file\n");
|
||||
ret = -EINVAL;
|
||||
goto errout_with_name;
|
||||
}
|
||||
|
Reference in New Issue
Block a user