Fix critical bug where a collumn with newline or tab would scramble the data

This commit is contained in:
Aslan2142 2022-08-20 13:15:02 -04:00
parent 7121754106
commit a453286ba7

View file

@ -34,6 +34,8 @@ void passman::encrypt()
{
for (QString& entry_column : entry_row)
{
entry_column = entry_column.replace("\n", "");
entry_column = entry_column.replace("\t", "");
data.append((entry_column + '\t').toLocal8Bit());
}
data.append(QString('\n').toLocal8Bit());
@ -66,6 +68,7 @@ bool passman::decrypt()
{
if (ch == '\n')
{
std::cout << line.toStdString() << std::endl;
if (line == "password")
{
line = "";