/* virt-df
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include <inttypes.h>
#include <xvasprintf.h>
#include <math.h>
print_title (void)
{
const char *cols[6];
- size_t i;
cols[0] = _("VirtualMachine");
cols[1] = _("Filesystem");
/* Use 'ceil' on the percentage in order to emulate what df itself does. */
snprintf (buf[3], MAX_LEN, "%3.0f%%", ceil (percent));
else
- snprintf (buf[3], MAX_LEN, "%.1f", percent);
+ snprintf (buf[3], MAX_LEN, "%.1f", (double) percent);
cols[3] = buf[3];
#undef MAX_LEN