fixes for C89

This commit is contained in:
Sergio R. Caprile committed 2025-10-01 13:51:37 -03:00
1 parent 776360ca93
commit ad58a48144
6 files changed
+35 -43

No files matched your search

+9
View File
@@ -2265,6 +2265,15 @@ static void test_str(void) {
ASSERT(sn("%s ", "a"));
ASSERT(sn("%s %s", "a", "b"));
ASSERT(sn("%2s %s", "a", "b"));
{ // mg_queue_printf()
struct mg_queue q;
char buf[128];
mg_queue_init(&q, buf, sizeof(buf));
void *p = (void *) 0xffffffffffffffff;
size_t len = mg_queue_printf(&q, "A%p%p%pB", p, p, p);
ASSERT(len == 56);
ASSERT(memcmp(buf + 4, "A0xffffffffffffffff0xffffffffffffffff0xffffffffffffffffB", 56) == 0);
}
// Non-standard formatting
{