Commit 59f185c
committed
knownhosts: fix hashed hostname component count in error message
Correct the component splitting in the nextWord function to omit the
initial empty element when decoding the pipe-separated hostname hash.
Previously, the error message incorrectly counted this empty element,
leading to misleading errors like:
knownhosts: got 3 components, want 3
This change makes the component split start from index 1.
The existing tests cover the changed code.
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>1 parent d042a39 commit 59f185c
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
485 | | - | |
| 484 | + | |
| 485 | + | |
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
491 | | - | |
| 490 | + | |
| 491 | + | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| |||
0 commit comments