mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-14 18:57:07 -07:00
Show expected & received length in error messages (#277)
This commit is contained in:
parent
736b4835df
commit
d4b4681a0f
1 changed files with 6 additions and 1 deletions
|
@ -116,7 +116,9 @@ int real_main(int argc, char *argv[])
|
|||
QByteArray regist_key = parser.value(regist_key_option).toUtf8();
|
||||
if(regist_key.length() > sizeof(ChiakiConnectInfo::regist_key))
|
||||
{
|
||||
printf("Given regist key is too long.\n");
|
||||
printf("Given regist key is too long (expected size <=%llu, got %d)\n",
|
||||
(unsigned long long)sizeof(ChiakiConnectInfo::regist_key),
|
||||
regist_key.length());
|
||||
return 1;
|
||||
}
|
||||
regist_key += QByteArray(sizeof(ChiakiConnectInfo::regist_key) - regist_key.length(), 0);
|
||||
|
@ -124,6 +126,9 @@ int real_main(int argc, char *argv[])
|
|||
QByteArray morning = QByteArray::fromBase64(parser.value(morning_option).toUtf8());
|
||||
if(morning.length() != sizeof(ChiakiConnectInfo::morning))
|
||||
{
|
||||
printf("Given morning has invalid size (expected %llu, got %d)\n",
|
||||
(unsigned long long)sizeof(ChiakiConnectInfo::morning),
|
||||
morning.length());
|
||||
printf("Given morning has invalid size (expected %llu)", (unsigned long long)sizeof(ChiakiConnectInfo::morning));
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue