sprintf
Posted: Mon Feb 24, 2014 7:17 pm
am i right in thinking if i want sprintf support, i should use chsnprintf ?
if so ive added memstreams.c to makefile and this is how im calling it
struct tm t;
static char msgstr1[100];
static const char LOGFILE_ENTRY_FORMAT[] = {"[%.2d/%.2d/%.2d - %.2d:%.2d:%.2d.%.3d] - [%.4d] %s\r\n"};
rtcGetTimeTm( &RTCD1, &t );
chsnprintf( msgstr1,
sizeof(msgstr1),
LOGFILE_ENTRY_FORMAT,
t.tm_mday, t.tm_mon - 1, t.tm_year - 100,
t.tm_hour, t.tm_min, t.tm_sec, (int)0,
(const char *)"This is a debug test message");
but just get unhandled exception and dbg_panic_msg is NULL ??
if so ive added memstreams.c to makefile and this is how im calling it
struct tm t;
static char msgstr1[100];
static const char LOGFILE_ENTRY_FORMAT[] = {"[%.2d/%.2d/%.2d - %.2d:%.2d:%.2d.%.3d] - [%.4d] %s\r\n"};
rtcGetTimeTm( &RTCD1, &t );
chsnprintf( msgstr1,
sizeof(msgstr1),
LOGFILE_ENTRY_FORMAT,
t.tm_mday, t.tm_mon - 1, t.tm_year - 100,
t.tm_hour, t.tm_min, t.tm_sec, (int)0,
(const char *)"This is a debug test message");
but just get unhandled exception and dbg_panic_msg is NULL ??