]> git.sur5r.net Git - i3/i3status/blobdiff - src/print_disk_info.c
Merge pull request #142 from tommie/incremental_multibatt
[i3/i3status] / src / print_disk_info.c
index 12d75857cf8dce882a19521d9726473877c9f972..629e05b30d041eed235800133810bed05560a0c5 100644 (file)
@@ -127,7 +127,9 @@ void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const ch
     if (statvfs(path, &buf) == -1) {
         /* If statvfs errors, e.g., due to the path not existing,
          * we use the format for a not mounted device. */
-        format = format_not_mounted;
+        if (format_not_mounted != NULL) {
+            format = format_not_mounted;
+        }
     } else if (format_not_mounted != NULL) {
         FILE *mntentfile = setmntent("/etc/mtab", "r");
         struct mntent *m;