diff options
author | Norbert Preining <norbert@preining.info> | 2020-07-08 03:01:45 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-07-08 03:01:45 +0000 |
commit | 8c3fedd243b69349b426144e5e2b94ef4aea6a4c (patch) | |
tree | f5842753f11a90141f3cc2e356c3a04766e8d81e /graphics/asymptote/fileio.h | |
parent | ef87f13c4503a2aa4a9098cbf33e0bfcad19008e (diff) |
CTAN sync 202007080301
Diffstat (limited to 'graphics/asymptote/fileio.h')
-rw-r--r-- | graphics/asymptote/fileio.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/graphics/asymptote/fileio.h b/graphics/asymptote/fileio.h index 1341d66b2d..762e541ad9 100644 --- a/graphics/asymptote/fileio.h +++ b/graphics/asymptote/fileio.h @@ -112,8 +112,16 @@ public: standardEOF(); } - void dimension(Int Nx=-1, Int Ny=-1, Int Nz=-1) {nx=Nx; ny=Ny; nz=Nz;} - + void dimension(Int Nx=-1, Int Ny=-1, Int Nz=-1) { + if(Nx < -1 || Ny < -1 || Nz < -1) { + ostringstream buf; + buf << "Invalid array dimensions: " << Nx << ", " << Ny << ", " << Nz; + reportError(buf); + } + + nx=Nx; ny=Ny; nz=Nz; + } + file(const string& name, bool check=true, Mode type=NOMODE, bool binary=false, bool closed=false) : name(name), check(check), type(type), linemode(false), csvmode(false), |