From 272439383ed407e9ffb43898100fb170a0d706e9 Mon Sep 17 00:00:00 2001 From: joncruz Date: Fri, 19 May 2006 04:19:52 +0000 Subject: [PATCH] Minor parameter type and snprintf safety tweak --- src/extension/internal/pdf-mini.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/extension/internal/pdf-mini.h b/src/extension/internal/pdf-mini.h index ca577443e..d12196a6d 100644 --- a/src/extension/internal/pdf-mini.h +++ b/src/extension/internal/pdf-mini.h @@ -151,11 +151,13 @@ long PdfFile::puts(PdfXref *table) { os << "xref\n"; os << "0" << " " << size << "\n"; - sprintf(buffer, "%010d %05d %c \n", 0, 65535, 'f'); + snprintf(buffer, sizeof(buffer), "%010d %05d %c \n", 0, 65535, 'f'); + buffer[sizeof(buffer)-1] = 0; os << buffer; for (i = 1; i < size; i++) { - sprintf(buffer, "%010d %05d %c \n", table->get_entry(i), 0, 'n'); + snprintf(buffer, sizeof(buffer), "%010d %05d %c \n", (int)table->get_entry(i), 0, 'n'); + buffer[sizeof(buffer)-1] = 0; os << buffer; } -- 2.30.2