1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
diff --git a/Config.tmpl b/Config.tmpl
index d20da21..758aed8 100644
--- a/Config.tmpl
+++ b/Config.tmpl
@@ -55,3 +55,6 @@
/* Ne pas dfinir pour utiliser mktemp() au lieu de mkstemp() */
#define HAS_MKSTEMP
+/* Pour viter les dpassements de capacit des buffers si l'OS le permet */
+#define HAS_SNPRINTF
+
diff --git a/imprime.c b/imprime.c
index 59e6bc1..59a2ff1 100644
--- a/imprime.c
+++ b/imprime.c
@@ -52,11 +52,19 @@ int mode;
else {
if (mode == VIDEOTEX) {
videotexDumpScreen (ecran_minitel, fp);
+#ifdef HAS_SNPRINTF
+ snprintf (cmd, sizeof(cmd), rsc_xtel.commandeImpression, n);
+#else
sprintf (cmd, rsc_xtel.commandeImpression, n);
+#endif
}
else { /* ASCII */
videotexConversionAscii (ecran_minitel, fp);
+#ifdef HAS_SNPRINTF
+ snprintf (cmd, sizeof(cmd), rsc_xtel.commandeImpressionAscii, n);
+#else
sprintf (cmd, rsc_xtel.commandeImpressionAscii, n);
+#endif
}
fclose (fp);
|