From: Andre Noll Date: Sat, 1 Nov 2008 23:31:38 +0000 (+0100) Subject: format_items(): Check for NULL pointers. X-Git-Tag: v0.0.4~12 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=a6c1851843a79d048fb43ec435107a795b8e986e;p=adu.git format_items(): Check for NULL pointers. And return NULL in this case, just as for an empty item list. --- diff --git a/format.c b/format.c index f6b1f48..a3a01ba 100644 --- a/format.c +++ b/format.c @@ -401,6 +401,8 @@ char *format_items(struct format_info *info, union atom_value *values) int i; char *buf = NULL; + if (!info) + return NULL; for (i = 0; info->items[i]; i++) { struct atom *a; struct format_item *fi = info->items[i];