diff options
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-annot-edit.c | 2 | ||||
-rw-r--r-- | source/pdf/pdf-cmap-load.c | 5 | ||||
-rw-r--r-- | source/pdf/pdf-portfolio.c | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index c1351d7c..1dc14ac2 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -689,7 +689,7 @@ static void find_free_font_name(fz_context *ctx, pdf_obj *fdict, char *buf, int /* Find a number X such that /FX doesn't occur as a key in fdict */ for (i = 0; 1; i++) { - snprintf(buf, buf_size, "F%d", i); + fz_snprintf(buf, buf_size, "F%d", i); if (!pdf_dict_gets(ctx, fdict, buf)) break; diff --git a/source/pdf/pdf-cmap-load.c b/source/pdf/pdf-cmap-load.c index 87b1c282..d73749cd 100644 --- a/source/pdf/pdf-cmap-load.c +++ b/source/pdf/pdf-cmap-load.c @@ -89,7 +89,10 @@ pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes) fz_try(ctx) { unsigned int high = (1 << (bytes * 8)) - 1; - sprintf(cmap->cmap_name, "Identity-%c", wmode ? 'V' : 'H'); + if (wmode) + fz_strlcpy(cmap->cmap_name, "Identity-V", sizeof cmap->cmap_name); + else + fz_strlcpy(cmap->cmap_name, "Identity-H", sizeof cmap->cmap_name); pdf_add_codespace(ctx, cmap, 0, high, bytes); pdf_map_range_to_range(ctx, cmap, 0, high, 0); pdf_sort_cmap(ctx, cmap); diff --git a/source/pdf/pdf-portfolio.c b/source/pdf/pdf-portfolio.c index 44201b41..9235880c 100644 --- a/source/pdf/pdf-portfolio.c +++ b/source/pdf/pdf-portfolio.c @@ -311,7 +311,7 @@ void pdf_add_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry, con pdf_drop_obj(ctx, num_name); num_name = NULL; num++; - sprintf(str_name, "%d", num); + fz_snprintf(str_name, sizeof str_name, "%d", num); num_name = pdf_new_name(ctx, doc, str_name); p = doc->portfolio; for (p = doc->portfolio; p; p = p->next) |