Skip to content

Commit

Permalink
Fixed #154 - Crash while parsing log
Browse files Browse the repository at this point in the history
  • Loading branch information
Fma965 committed Sep 19, 2021
1 parent 22c0ca0 commit 8a872b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Launcher/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.10.4.0")]
[assembly: AssemblyFileVersion("2.10.4.0")]
[assembly: AssemblyVersion("2.10.5.0")]
[assembly: AssemblyFileVersion("2.10.5.0")]
20 changes: 11 additions & 9 deletions Syn3Updater/Converter/HexToASCII.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace Cyanlabs.Syn3Updater.Converter
{
public class SyncHexToAscii
public static class SyncHexToAscii
{
public static List<string> ConvertPackages( string packageHex)
{
List<string> output = new();
foreach (string package in Regex.Replace(packageHex, "0*0", " ").Split(' '))
string res = string.Empty;
for (int a = 0; a <packageHex.Length ; a += 2)
{
string res = string.Empty ;
for (int a = 0; a <package.Length ; a += 2)
string char2Convert = packageHex.Substring(a, 2);
if (char2Convert == "00")
{
res += "_";
}
else
{
string char2Convert = package.Substring(a, 2);
int n = Convert.ToInt32(char2Convert, 16);
char c = (char)n;
res += c.ToString();
}
if (res != string.Empty) output.Add(res);
}
return output;
return Regex.Replace(res, "_*_", "_").Split('_').ToList();
}

}
}
4 changes: 2 additions & 2 deletions Syn3Updater/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@
// You can specify all the values or you can default the Build a nd Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.10.4.0")]
[assembly: AssemblyFileVersion("2.10.4.0")]
[assembly: AssemblyVersion("2.10.5.0")]
[assembly: AssemblyFileVersion("2.10.5.0")]

0 comments on commit 8a872b7

Please sign in to comment.