From d733a88e61631094bece5d1490ecf8f71877536c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 23 May 2014 10:46:53 +0100 Subject: coverity#707899 Uninitialized scalar field Change-Id: I49c6e56412e10155ddb2b8f4b492a3420e1b6718 --- hwpfilter/source/hinfo.cxx | 3 +-- hwpfilter/source/hinfo.h | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) (limited to 'hwpfilter') diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx index 98f66a5028b1..38d3b22fe659 100644 --- a/hwpfilter/source/hinfo.cxx +++ b/hwpfilter/source/hinfo.cxx @@ -66,8 +66,7 @@ HWPInfo::HWPInfo() HWPInfo::~HWPInfo(void) { - if (info_block) - delete[]info_block; + delete[] info_block; info_block = 0; } diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h index d3591b5ec68d..00bc6046c9b4 100644 --- a/hwpfilter/source/hinfo.h +++ b/hwpfilter/source/hinfo.h @@ -33,7 +33,7 @@ class CHTMLOut; /** * Information of page (phisical) */ -typedef struct +struct PaperInfo { unsigned char paper_kind; unsigned char paper_direction; @@ -46,7 +46,21 @@ typedef struct hunit header_length; hunit footer_length; hunit gutter_length; -} PaperInfo; + PaperInfo() + : paper_kind(0) + , paper_direction(0) + , paper_height(0) + , paper_width(0) + , top_margin(0) + , bottom_margin(0) + , left_margin(0) + , right_margin(0) + , header_length(0) + , footer_length(0) + , gutter_length(0) + { + } +}; /* ?????? ??????, ???????? ???? */ struct PaperBackInfo @@ -146,7 +160,7 @@ class DLLEXPORT HWPInfo */ PaperInfo paper; - PaperBackInfo back_info; + PaperBackInfo back_info; /** * Sets the attribute of read-only or read/write. */ -- cgit