Skip to content

Commit

Permalink
Merge pull request #1533 from stweil/cov
Browse files Browse the repository at this point in the history
Fix some issues reported by Coverity Scan
  • Loading branch information
zdenop authored Apr 26, 2018
2 parents af72ad7 + fbeb55c commit 37d2088
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/ccutil/elst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ ELIST_LINK *ELIST_ITERATOR::forward() {
cycle_pt = next;
current = next;
}
#ifndef NDEBUG
if (!current)
NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr);
#endif
next = current->next;

#ifndef NDEBUG
if (!current)
NULL_DATA.error ("ELIST_ITERATOR::forward", ABORT, nullptr);
if (!next)
NULL_NEXT.error ("ELIST_ITERATOR::forward", ABORT,
"This is: %p Current is: %p", this, current);
Expand Down
4 changes: 2 additions & 2 deletions src/training/stringrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ Pix* CairoARGB32ToPixFormat(cairo_surface_t *surface) {

StringRenderer::StringRenderer(const std::string& font_desc, int page_width,
int page_height)
: page_width_(page_width),
: font_(font_desc),
page_width_(page_width),
page_height_(page_height),
h_margin_(50),
v_margin_(50),
Expand Down Expand Up @@ -118,7 +119,6 @@ StringRenderer::StringRenderer(const std::string& font_desc, int page_width,
total_chars_(0),
font_index_(0),
last_offset_(0) {
set_font(font_desc);
set_resolution(kDefaultOutputResolution);
}

Expand Down
3 changes: 3 additions & 0 deletions src/viewer/svutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ void SVNetwork::Close() {
#else
close(stream_);
#endif
// Mark stream_ as invalid.
stream_ = -1;
}


Expand Down Expand Up @@ -448,6 +450,7 @@ SVNetwork::SVNetwork(const char* hostname, int port) {
}

SVNetwork::~SVNetwork() {
Close();
delete[] msg_buffer_in_;
}

Expand Down

0 comments on commit 37d2088

Please sign in to comment.