Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
24736e72
Kaydet (Commit)
24736e72
authored
May 04, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cppcheck: memleakOnRealloc
Change-Id: Ibdf762b0d397f798372d9bf882aa82a6e5fd0229
üst
90911df7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
hstream.cxx
hwpfilter/source/hstream.cxx
+6
-16
hstream.hxx
hwpfilter/source/hstream.hxx
+3
-2
No files found.
hwpfilter/source/hstream.cxx
Dosyayı görüntüle @
24736e72
...
...
@@ -21,27 +21,19 @@
#include <stdlib.h>
#include "hstream.hxx"
HStream
::
HStream
()
:
size
(
0
),
pos
(
0
)
HStream
::
HStream
()
:
size
(
0
)
,
pos
(
0
)
{
seq
=
0
;
}
HStream
::~
HStream
()
{
if
(
seq
)
free
(
seq
);
}
void
HStream
::
addData
(
const
byte
*
buf
,
int
aToAdd
)
void
HStream
::
addData
(
const
byte
*
buf
,
int
aToAdd
)
{
seq
=
static_cast
<
byte
*>
(
realloc
(
seq
,
size
+
aToAdd
)
);
memcpy
(
seq
+
size
,
buf
,
aToAdd
);
seq
.
resize
(
size
+
aToAdd
);
memcpy
(
seq
.
data
()
+
size
,
buf
,
aToAdd
);
size
+=
aToAdd
;
}
int
HStream
::
readBytes
(
byte
*
buf
,
int
aToRead
)
{
if
(
aToRead
>=
(
size
-
pos
))
...
...
@@ -51,7 +43,6 @@ int HStream::readBytes(byte * buf, int aToRead)
return
aToRead
;
}
int
HStream
::
skipBytes
(
int
aToSkip
)
{
if
(
aToSkip
>=
(
size
-
pos
))
...
...
@@ -60,7 +51,6 @@ int HStream::skipBytes(int aToSkip)
return
aToSkip
;
}
int
HStream
::
available
()
const
{
return
size
-
pos
;
...
...
hwpfilter/source/hstream.hxx
Dosyayı görüntüle @
24736e72
...
...
@@ -20,6 +20,8 @@
#ifndef INCLUDED_HWPFILTER_SOURCE_HSTREAM_H
#define INCLUDED_HWPFILTER_SOURCE_HSTREAM_H
#include <vector>
typedef
unsigned
char
byte
;
/**
* Stream class
...
...
@@ -28,7 +30,6 @@ class HStream
{
public
:
HStream
();
virtual
~
HStream
();
/**
*
...
...
@@ -49,7 +50,7 @@ class HStream
private
:
int
size
;
byte
*
seq
;
std
::
vector
<
byte
>
seq
;
int
pos
;
};
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment