- sprintf(CS p, newformat, va_arg(ap, int));
+
+ /* Short int is promoted to int when passing through ..., so we must use
+ int for va_arg(). */
+
+ switch(length)
+ {
+ case L_SHORT:
+ case L_NORMAL: sprintf(CS p, newformat, va_arg(ap, int)); break;
+ case L_LONG: sprintf(CS p, newformat, va_arg(ap, long int)); break;
+ #ifdef ASSUME_LONG_LONG_SUPPORT
+ case L_LONGLONG: sprintf(CS p, newformat, va_arg(ap, long long int)); break;
+ #else
+ case L_LONGLONG: sprintf(CS p, newformat, va_arg(ap, long long int)); break;
+ #endif
+ }