src/message_api.c
changeset 855 27364c55fbaa
parent 854 0d068c87fa66
child 857 349cbf352179
     1.1 --- a/src/message_api.c	Tue Jul 12 19:52:16 2016 +0200
     1.2 +++ b/src/message_api.c	Tue Jul 12 20:24:58 2016 +0200
     1.3 @@ -86,9 +86,9 @@
     1.4  
     1.5      assert(shortmsg);
     1.6      assert(strcmp(shortmsg, "pEp") != 0);
     1.7 -    // Will crash without assert if shortmsg == NULL in strlen
     1.8 -    if (shortmsg == NULL)
     1.9 -        shortmsg = strdup(""); // Should this be "pEp", as above?
    1.10 +
    1.11 +    if (!shortmsg || strcmp(shortmsg, "pEp") == 0)
    1.12 +        return longmsg;
    1.13          
    1.14      if (longmsg == NULL)
    1.15          longmsg = "";