diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-21 11:33:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-21 12:24:31 +0100 |
commit | e8de073d6336a2a8e170ecb5e1598c8ff4819cef (patch) | |
tree | 4224736cff13586488106eb1799f2fed2f0c28aa /hwpfilter/source/htags.cxx | |
parent | Add bounding box of an elliptical arc and output the 'A' element (diff) | |
download | core-e8de073d6336a2a8e170ecb5e1598c8ff4819cef.tar.gz core-e8de073d6336a2a8e170ecb5e1598c8ff4819cef.zip |
use size_t here
Diffstat (limited to 'hwpfilter/source/htags.cxx')
-rw-r--r-- | hwpfilter/source/htags.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index 30244a83f9b8..94cc05058d7c 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -59,9 +59,10 @@ bool HyperText::Read(HWPFile & hwpf) } -EmPicture::EmPicture(int tsize):size(tsize - 32) +EmPicture::EmPicture(size_t tsize) + : size(tsize >= 32 ? tsize - 32 : 0) { - if (size <= 0) + if (size == 0) data = 0; else data = new uchar[size]; @@ -82,7 +83,7 @@ EmPicture::~EmPicture(void) bool EmPicture::Read(HWPFile & hwpf) { - if (size <= 0) + if (size == 0) return false; hwpf.Read1b(name, 16); hwpf.Read1b(type, 16); |