Assorted typo fixes in comments.
[adu.git] / format.c
index 37bb087ba02fff7f472d14b0739e715626263c26..8b96830291dd044399bbd7ebdcecb471674a62eb 100644 (file)
--- a/format.c
+++ b/format.c
@@ -1,10 +1,10 @@
 /*
- * Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008 Andre Noll <maan@tuebingen.mpg.de>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
-/** \file format.c Functions for pretty-printing numbers and strings. */
+/** \file format.c \brief Functions for pretty-printing numbers and strings. */
 
 #include <dirent.h> /* readdir() */
 #include "adu.h"
@@ -14,6 +14,7 @@
 #include "error.h"
 #include "format.h"
 
+/** The three different alignment types. */
 enum alignment {ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER};
 
 struct num_format {
@@ -448,14 +449,14 @@ char *format_items(struct format_info *info, union atom_value *values)
                        align = af->sf.align;
                        val = align_string(values[idx].string_value, fi->width, align);
                } else {
-                       char unit;
                        align = af->nf.align;
-                       unit = af->nf.unit;
                        val = align_unsigned_int(values[idx].num_value,
                                fi->width, &af->nf, type);
                }
                buf = adu_strcat(buf, val);
                free(val);
        }
+       if (!buf)
+               buf = adu_strdup("");
        return buf;
 }