GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — added asserts to streams to make sure the input is valid (#294) · cppcheck-opensource/simplecpp@2828bb1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • simplecpp.cpp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎simplecpp.cpp‎

Copy file name to clipboardExpand all lines: simplecpp.cpp
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "simplecpp.h"
2424

2525
#include <algorithm>
26+
#include <cassert>
2627
#include <climits>
2728
#include <cstddef>
2829
#include <cstdlib>
@@ -351,6 +352,7 @@ class StdIStream : public simplecpp::TokenList::Stream {
351352
StdIStream(std::istream &istr)
352353
: istr(istr)
353354
{
355+
assert(istr.good());
354356
init();
355357
}
356358

@@ -378,6 +380,7 @@ class FileStream : public simplecpp::TokenList::Stream {
378380
, lastCh(0)
379381
, lastStatus(0)
380382
{
383+
assert(file != nullptr);
381384
init();
382385
}
383386

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.