static void err_snprintf(char *buf, long len, const char *fmt, va_list args) { long n; n = err_position(buf, len); if (len > n) { vsnprintf((char*)buf+n, len-n, fmt, args); } }
void rb_bug(const char *fmt, ...) { char buf[BUFSIZ]; va_list args; FILE *out = stderr; int len = err_position(buf, BUFSIZ); if (fwrite(buf, 1, len, out) == len || fwrite(buf, 1, len, (out = stdout)) == len) { yarv_bug(); fputs("[BUG] ", out); va_start(args, fmt); vfprintf(out, fmt, args); va_end(args); fprintf(out, "\nruby %s (%s) [%s]\n\n", ruby_version, ruby_release_date, ruby_platform); } abort(); }