mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-14 02:47:07 +03:00
ace23ebbe2
git-svn-id: svn://kolibrios.org@6433 a494cfbc-eb01-0410-851d-a64ba20cac60
29 lines
451 B
C++
29 lines
451 B
C++
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
//#include <unistd.h>
|
|
//#include "test.h"
|
|
|
|
volatile int t_status = 0;
|
|
|
|
int t_printf(const char *s, ...)
|
|
{
|
|
va_list ap;
|
|
char buf[512];
|
|
int n;
|
|
|
|
t_status = 1;
|
|
va_start(ap, s);
|
|
n = vsnprintf(buf, sizeof buf, s, ap);
|
|
va_end(ap);
|
|
if (n < 0)
|
|
n = 0;
|
|
else if (n >= sizeof buf) {
|
|
n = sizeof buf;
|
|
buf[n - 1] = '0';
|
|
buf[n - 2] = '.';
|
|
buf[n - 3] = '.';
|
|
buf[n - 4] = '.';
|
|
}
|
|
return printf("%s\n", buf);
|
|
}
|