diff options
| author | Christian Kohlstedde | 2015-02-18 22:11:16 +0100 | 
|---|---|---|
| committer | Christian Kohlstedde | 2015-02-18 22:11:16 +0100 | 
| commit | 014e66563f2c988b07f1d168d7d673ff95c0c8a7 (patch) | |
| tree | 402ea95c398b648343b22cb46925e33c9d33b61c /src | |
| parent | Modify print_disk_info. Now there is no output if the path is no mountpoint. (diff) | |
Make the code more readable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/print_disk_info.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/src/print_disk_info.c b/src/print_disk_info.c index a9fcba3..ef028bd 100644 --- a/src/print_disk_info.c +++ b/src/print_disk_info.c @@ -131,7 +131,7 @@ void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const ch          struct mntent *m;          bool found = false; -        while ((m = getmntent(mntentfile))) { +        while (NULL != (m = getmntent(mntentfile))) {                  if (strcmp(m->mnt_dir, path) == 0) {                          found = true;                          break; @@ -139,8 +139,8 @@ void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const ch          }          endmntent(mntentfile); -        if(!found) { -                *outwalk = '\0'; +        if (!found) { +                *buffer = '\0';                  OUTPUT_FULL_TEXT(buffer);                  return;          } | 
