Liste des Groupes | Revenir à co vms |
On 6/23/25 9:35 PM, Arne Vajhøj wrote:I don't like the #elif HAVE_VSNPRINTF code in tds_vasprintf.On 6/23/2025 10:16 PM, Arne Vajhøj wrote:It turns out tds_vasprtintf already uses vsnprintf if HAVE_VSNPRINTF isBut why not just steal the trick from it instead of the whole code?>
>
The trick they use is va_copy.
>
I think tds_vasprintf could use va_copy to solve the problem as well!
On the other side, then ditching existing code and taking this
would also switch form vfprintf to vsnprintf for length
determination, which Lawrence is correct would be
better.
defined and only falls back to the /dev/null hack if not:
https://github.com/FreeTDS/freetds/blob/master/src/replacements/vasprintf.c
So my next change to FreeTDS will look something like this:
--- vms/config_h.vms;-0 Tue Sep 26 09:23:25 2023
+++ vms/config_h.vms Tue Jun 24 05:23:20 2025
@@ -237,7 +237,9 @@
#define HAVE_SNPRINTF @D_SNPRINTF@
/* Define to 1 if you have the `vsnprintf' function. */
-#define HAVE_VSNPRINTF 0
+#if __CRTL_VER >= 70302000
+#define HAVE_VSNPRINTF 1
+#endif
/* Define as const if the declaration of iconv() needs const. */
#if HAVE_ICONV
[end_of_patch]
That should cover everybody with a VMS system from recent decades.
Les messages affichés proviennent d'usenet.