From: Christian Kohlstedde Date: Wed, 18 Feb 2015 21:11:16 +0000 (+0100) Subject: Make the code more readable. X-Git-Tag: 2.9~5^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=014e66563f2c988b07f1d168d7d673ff95c0c8a7;p=i3%2Fi3status Make the code more readable. --- 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; }