merge default into my branch roker-linux
authorRoker <roker@pep-project.org>
Wed, 13 Jul 2016 09:13:39 +0200
branchroker-linux
changeset 859a3e8f082fc8a
parent 856 3061adc7e3c6
parent 857 349cbf352179
child 863 c4d31c928b9f
merge default into my branch
     1.1 --- a/src/message_api.c	Mon Jul 11 18:58:35 2016 +0200
     1.2 +++ b/src/message_api.c	Wed Jul 13 09:13:39 2016 +0200
     1.3 @@ -87,8 +87,16 @@
     1.4      assert(shortmsg);
     1.5      assert(strcmp(shortmsg, "pEp") != 0);
     1.6  
     1.7 -    if (!shortmsg || strcmp(shortmsg, "pEp") == 0)
     1.8 -        return longmsg;
     1.9 +    if (!shortmsg || strcmp(shortmsg, "pEp") == 0) {
    1.10 +        if (!longmsg) {
    1.11 +            return NULL;
    1.12 +        }
    1.13 +        else {
    1.14 +            char *result = strdup(longmsg);
    1.15 +            assert(result);
    1.16 +            return result;
    1.17 +        }
    1.18 +    }
    1.19          
    1.20      if (longmsg == NULL)
    1.21          longmsg = "";