Guard functions with assert as it's programming error to invoke
it with null path.
Change-Id: I3a312f90c0553c1dd9e9233551c0d42b89c260f7
* @brief dump system states.
*/
+#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
);
}
-/* get disk used percentage */
static int get_disk_used_percent(const char *path)
{
+ assert(path);
+
struct statfs lstatfs;
int percent;
- if (!path)
- return -1;
-
if (statfs(path, &lstatfs) < 0)
return -1;
percent = (((lstatfs.f_blocks - lstatfs.f_bfree) * 1000) / (lstatfs.f_blocks)) + 9;