if( pM->zText && nNewChar>0 ){ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); pM->nChar += nNewChar;
if( pM->zText ){ if( nNewChar>0 ){ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar); pM->nChar += nNewChar; }
static void mout(void *arg, const char *zNewText, int nNewChar){  struct sgMprintf *pM = (struct sgMprintf*)arg;  pM->nTotal += nNewChar;  if( pM->nChar + nNewChar + 1 > pM->nAlloc ){    if( pM->xRealloc==0 ){      nNewChar =  pM->nAlloc - pM->nChar - 1;    }else{      pM->nAlloc = pM->nChar + nNewChar*2 + 1;      if( pM->zText==pM->zBase ){        pM->zText = pM->xRealloc(0, pM->nAlloc);        if( pM->zText && pM->nChar ){          memcpy(pM->zText, pM->zBase, pM->nChar);        }      }else{        pM->zText = pM->xRealloc(pM->zText, pM->nAlloc);      }    }  }  if( pM->zText && nNewChar>0 ){    memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);    pM->nChar += nNewChar;    pM->zText[pM->nChar] = 0;  }}