WIP Update lib to 2.37

This commit is contained in:
2017-10-20 20:02:52 +02:00
committed by BONNEVILLE Geoffroy
parent 9de9ae54da
commit d5b7845242
105 changed files with 9829 additions and 2410 deletions

View File

@@ -1,6 +1,6 @@
/*
KeePass Password Safe - The Open-Source Password Manager
Copyright (C) 2003-2014 Dominik Reichl <dominik.reichl@t-online.de>
Copyright (C) 2003-2017 Dominik Reichl <dominik.reichl@t-online.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,8 +19,8 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Text;
using ModernKeePassLib.Utility;
@@ -31,7 +31,7 @@ namespace ModernKeePassLib.Serialization
private Stream m_s;
// private Encoding m_enc; // See constructor
private string m_strReadExcp;
private string m_strReadExcp; // May be null
public string ReadExceptionText
{
get { return m_strReadExcp; }
@@ -53,8 +53,7 @@ namespace ModernKeePassLib.Serialization
public BinaryReaderEx(Stream input, Encoding encoding,
string strReadExceptionText)
{
if(input == null)
throw new ArgumentNullException("input");
if(input == null) throw new ArgumentNullException("input");
m_s = input;
// m_enc = encoding; // Not used yet
@@ -68,20 +67,18 @@ namespace ModernKeePassLib.Serialization
byte[] pb = MemUtil.Read(m_s, nCount);
if((pb == null) || (pb.Length != nCount))
{
if(m_strReadExcp != null)
throw new IOException(m_strReadExcp);
else
throw new EndOfStreamException();
if(!string.IsNullOrEmpty(m_strReadExcp))
throw new EndOfStreamException(m_strReadExcp);
else throw new EndOfStreamException();
}
if(m_sCopyTo != null)
m_sCopyTo.Write(pb, 0, pb.Length);
if(m_sCopyTo != null) m_sCopyTo.Write(pb, 0, pb.Length);
return pb;
}
catch(Exception)
{
if(m_strReadExcp != null)
throw new IOException(m_strReadExcp);
if(!string.IsNullOrEmpty(m_strReadExcp))
throw new IOException(m_strReadExcp);
else throw;
}
}