{
ssize_t pos = flags & M_FORMAT_ARROWCURSOR ? 3 : 0;
+ if (dlen >= 0)
+ *dst = '\0';
+
while (*fmt) {
- char ifstring[STRING], elsestring[STRING], prefix[STRING] = "";
int ch;
if (*fmt == '%') {
+ char ifstring[STRING], elsestring[STRING], prefix[STRING];
+
+ *ifstring = *elsestring = *prefix = '\0';
+
if (*++fmt == '%') {
pos += m_strputc(dst + pos, dlen - pos, *fmt++);
continue;
if (!*fmt++) /* move past the trailing `?' */
break; /* bad format */
- } else {
- *ifstring = *elsestring = '\0';
}
switch (ch) {