Skip to content

Commit

Permalink
string_builder: Fix format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
zeldin committed Feb 19, 2023
1 parent ea4a03b commit 2d33dc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/string_builder.cmod
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ PMOD_EXPORT void string_builder_strftime(struct string_builder *s,
case 's': /* Seconds since epoch. */
{
time_t t = mktime_zone(tm, 0, 0);
string_builder_sprintf(s, "%d", t);
string_builder_sprintf(s, "%ld", (long)t);
}
break;

Expand Down Expand Up @@ -1712,7 +1712,7 @@ PMOD_EXPORT void string_builder_append_disassembly_data(struct string_builder *s

buf_len = s->s->len;
if (comment) {
string_builder_sprintf(s, " .data %-20q", &tmp);
string_builder_sprintf(s, " .data %-20pq", &tmp);
if (UNLIKELY(s->s->len > buf_len + 10 + 20)) {
/* Paranoia: This probably can't happen.
* Max should be with octal or hex quoting:
Expand All @@ -1725,7 +1725,7 @@ PMOD_EXPORT void string_builder_append_disassembly_data(struct string_builder *s
skip_comment = 1;
}
} else {
string_builder_sprintf(s, " .data %q", &tmp);
string_builder_sprintf(s, " .data %pq", &tmp);
}
} else if (comment) {
pos_end = NULL;
Expand Down

0 comments on commit 2d33dc7

Please sign in to comment.