Thread

Zero-JS Hypermedia Browser

Relays: 5
Replies: 8
Generated: 00:27:10
Login to reply

Replies (8)

GCC does compile-time checks too, but they're both valid, and both print a string of the given width, but %*.s is weird and should probably elicit a warning. The man page suggests this will print padding (* specifies the minimum width, . specifies zero precision, so no chars from string are printed) and that the string need not be nul terminated, but it printed something and valgrind complained (string was *not* nul terminated), so I suspect the man page or implementation are wrong. But it's really a "did you mean %*." warning because I expect no code deliberately does this...
2025-10-26 11:09:17 from 1 relay(s) ↑ Parent 1 replies ↓ Reply
Oh I thought you had a format string where you just wanted a literal. Null termination should still be handled by types (string vs span perhaps) rather than format spec, though i guess that's straying further from C.
2025-10-26 12:13:41 from 1 relay(s) ↑ Parent Reply