Back to index

lightning-sunbird  0.9+nobinonly
nsNNTPNewsgroupPost.cpp File Reference
#include "msgCore.h"
#include "nsINNTPNewsgroupPost.h"
#include "nsNNTPNewsgroupPost.h"
#include "nsISupportsObsolete.h"
#include "plstr.h"
#include "prmem.h"

Go to the source code of this file.


static char * AppendAndAlloc (char *string, const char *newSubstring, PRBool withComma)

Function Documentation

static char* AppendAndAlloc ( char *  string,
const char *  newSubstring,
PRBool  withComma 
) [static]

Definition at line 76 of file nsNNTPNewsgroupPost.cpp.

    if (!newSubstring) return NULL;
    if (!string) return PL_strdup(newSubstring);
    char *separator = (char *) (withComma ? ", " : " ");
    char *oldString = string;
    string = (char *)PR_Calloc(PL_strlen(oldString) +
                               PL_strlen(separator) +
                               PL_strlen(newSubstring) + 1,
    PL_strcpy(string, oldString);
    PL_strcat(string, separator);
    PL_strcat(string, newSubstring);

    return string;

Here is the call graph for this function:

Here is the caller graph for this function: