From: Andre Noll Date: Wed, 31 Oct 2007 00:13:36 +0000 (+0100) Subject: attribute.c: Always provide the attributes text. X-Git-Tag: v0.3.0~166 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=fc1e00eb81d5e7150d54b04bc0fd5021b03156f4;p=paraslash.git attribute.c: Always provide the attributes text. If no attributes are defined, return the string "(no attributes available)" rather than a NULL pointer. --- diff --git a/attribute.c b/attribute.c index 3acbadbe..88b394ad 100644 --- a/attribute.c +++ b/attribute.c @@ -530,8 +530,10 @@ int get_attribute_text(uint64_t *atts, const char *delim, char **text) const uint64_t one = 1; *text = NULL; - if (greatest_att_bitnum < 0) /* no attributes available */ + if (greatest_att_bitnum < 0) { /* no attributes available */ + *text = para_strdup("(no attributes available)"); return 1; + } for (i = 0; i <= greatest_att_bitnum; i++) { unsigned char bn = i; struct osl_object obj = {.data = &bn, .size = 1};