diff --git a/calma/CalmaRead.c b/calma/CalmaRead.c index 065f208e..00842b4c 100644 --- a/calma/CalmaRead.c +++ b/calma/CalmaRead.c @@ -445,6 +445,9 @@ void CalmaReadError(char *format, ...) { TxError("Error while reading cell \"%s\" ", cifReadCellDef->cd_name); TxError("(byte position %"DLONG_PREFIX"d): ", (dlong)filepos); + va_start(args, format); + TxErrorV(format, args); + va_end(args); } } else if ((calmaTotalErrors == 100) && (CIFWarningLevel == CIF_WARN_LIMIT)) diff --git a/textio/textio.h b/textio/textio.h index d14c7b90..aa3e5fff 100644 --- a/textio/textio.h +++ b/textio/textio.h @@ -69,6 +69,7 @@ extern void TxStopMore(); /* printing procedures with variable arguments lists */ extern void TxError(char *, ...); +extern void TxErrorV(char *, va_list args); extern void TxPrintf(char *, ...); extern char *TxPrintString(char *, ...); diff --git a/textio/txOutput.c b/textio/txOutput.c index 5813b153..085bcf15 100644 --- a/textio/txOutput.c +++ b/textio/txOutput.c @@ -302,9 +302,15 @@ TxFlush() */ void -TxError(char *fmt, ...) -{ +TxError(char *fmt, ...) { va_list args; + va_start(args, fmt); + va_end(args); +} + +void +TxErrorV(char *fmt, va_list args) +{ FILE *f; TxFlushOut(); @@ -312,7 +318,6 @@ TxError(char *fmt, ...) f = TxMoreFile; else f = stderr; - va_start(args, fmt); if (txHavePrompt) { TxUnPrompt(); @@ -322,7 +327,6 @@ TxError(char *fmt, ...) else { Vfprintf(f, fmt, args); } - va_end(args); TxFlushErr(); }