char *flags = NULL;
char *flags = xnfcalloc(1, 1);
PrintModeline(int scrnIndex,DisplayModePtr mode){    char tmp[256];    char *flags = NULL;    if (mode->HSkew) {         snprintf(tmp,256,"hskew %i",mode->HSkew); 	add(&flags,tmp);    }    if (mode->VScan) {         snprintf(tmp,256,"vscan %i",mode->VScan); 	add(&flags,tmp);    }    if (mode->Flags & V_INTERLACE) add(&flags,"interlace");    if (mode->Flags & V_CSYNC) add(&flags,"composite");    if (mode->Flags & V_DBLSCAN) add(&flags,"doublescan");    if (mode->Flags & V_BCAST) add(&flags,"bcast");    if (mode->Flags & V_PHSYNC) add(&flags,"+hsync");    if (mode->Flags & V_NHSYNC) add(&flags,"-hsync");    if (mode->Flags & V_PVSYNC) add(&flags,"+vsync");    if (mode->Flags & V_NVSYNC) add(&flags,"-vsync");    if (mode->Flags & V_PCSYNC) add(&flags,"+csync");    if (mode->Flags & V_NCSYNC) add(&flags,"-csync");    xf86DrvMsgVerb(scrnIndex,X_INFO,3,		   "Modeline \"%s\"  %6.2f  %i %i %i %i  %i %i %i %i %s\n",		   mode->name,mode->Clock/1000., mode->HDisplay,		   mode->HSyncStart,mode->HSyncEnd,mode->HTotal,		   mode->VDisplay,mode->VSyncStart,mode->VSyncEnd,		   mode->VTotal,flags);    xfree(flags);}