[hyena] Safely cast stream.Read () to char
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hyena] Safely cast stream.Read () to char
- Date: Wed, 26 May 2010 02:32:40 +0000 (UTC)
commit c4b990cd1ac5cce12555b855b195f0c8037b9115
Author: Gabriel Burt <gabriel burt gmail com>
Date: Mon Feb 1 19:35:00 2010 -0800
Safely cast stream.Read () to char
src/Hyena/Hyena.Json/Tokenizer.cs | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/Hyena/Hyena.Json/Tokenizer.cs b/src/Hyena/Hyena.Json/Tokenizer.cs
index 90d1dd4..3091d71 100644
--- a/src/Hyena/Hyena.Json/Tokenizer.cs
+++ b/src/Hyena/Hyena.Json/Tokenizer.cs
@@ -75,7 +75,8 @@ namespace Hyena.Json
private void ReadChar ()
{
- peek = (char)reader.Read ();
+ int val = reader.Read ();
+ peek = val == -1 ? Char.MinValue : (char)val;
current_column++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]