Skip to content

Commit

Permalink
Use DUK_SNPRINTF in numconv
Browse files Browse the repository at this point in the history
  • Loading branch information
hf committed Jan 8, 2020
1 parent 825139f commit b6e7798
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src-input/duk_numconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ DUK_LOCAL void duk__bi_print(const char *name, duk__bigint *x) {
duk_small_int_t i;

/* No NUL term checks in this debug code. */
p += DUK_SPRINTF(p, "%p n=%ld", (void *) x, (long) x->n);
p += DUK_SNPRINTF(p, sizeof(buf), "%p n=%ld", (void *) x, (long) x->n);
if (x->n == 0) {
p += DUK_SPRINTF(p, " 0");
p += DUK_SNPRINTF(p, 3, " 0");
}
for (i = x->n - 1; i >= 0; i--) {
p += DUK_SPRINTF(p, " %08lx", (unsigned long) x->v[i]);
p += DUK_SNPRINTF(p, 10, " %08lx", (unsigned long) x->v[i]);
}

DUK_DDD(DUK_DDDPRINT("%s: %s", (const char *) name, (const char *) buf));
Expand Down

0 comments on commit b6e7798

Please sign in to comment.