From cd001102f885c5c257051b397ac9fa3319c70596 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 15 Dec 2018 15:16:11 +0100 Subject: [PATCH] fixed bug in write_chars --- hyper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyper.h b/hyper.h index a6def14c..9828ff86 100644 --- a/hyper.h +++ b/hyper.h @@ -4273,7 +4273,7 @@ struct hstream_exception : std::exception { hstream_exception() {} }; struct fhstream : hstream { FILE *f; virtual void write_char(char c) { write_chars(&c, 1); } - virtual void write_chars(char* c, size_t i) { if(fwrite(c, i, 1, f) != 1) throw hstream_exception(); } + virtual void write_chars(const char* c, size_t i) { if(fwrite(c, i, 1, f) != 1) throw hstream_exception(); } virtual void read_chars(char* c, size_t i) { if(fread(c, i, 1, f) != 1) throw hstream_exception(); } virtual char read_char() { char c; read_chars(&c, 1); return c; } fhstream() { f = NULL; }