X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=blobdiff_plain;f=format.c;h=e8a9a28617656700fda8352ec82bd1fb2517e144;hp=37bb087ba02fff7f472d14b0739e715626263c26;hb=ca20c17a6742464bcf861fe856a4caddf2bfeab2;hpb=9e41a10fbee567866d78903b11646d341cfd9882 diff --git a/format.c b/format.c index 37bb087..e8a9a28 100644 --- a/format.c +++ b/format.c @@ -4,7 +4,7 @@ * 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 /* 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 { @@ -457,5 +458,7 @@ char *format_items(struct format_info *info, union atom_value *values) buf = adu_strcat(buf, val); free(val); } + if (!buf) + buf = adu_strdup(""); return buf; }