commit b487c712407a1e17168b8b89696f7569bc981bbf
Author:     Laslo Hunhold <[email protected]>
AuthorDate: Mon Jun 1 12:32:09 2020 +0200
Commit:     Laslo Hunhold <[email protected]>
CommitDate: Mon Jun 1 12:32:09 2020 +0200

    Add to rather than subtract from unsigned integer
    
    It doesn't make a difference here, as the array of test cases
    can not be empty, but it makes sense to be consistent with resilient
    programming.
    
    Signed-off-by: Laslo Hunhold <[email protected]>

diff --git a/src/test_body.c b/src/test_body.c
index 08d2d9e..3cf445d 100644
--- a/src/test_body.c
+++ b/src/test_body.c
@@ -308,14 +308,14 @@ int main(void)
                        for (j = 0; j < enc_test[i].exp_len; j++) {
                                fprintf(stderr, "0x%x",
                                        enc_test[i].exp_arr[j]);
-                               if (j != enc_test[i].exp_len - 1) {
+                               if (j + 1 < enc_test[i].exp_len) {
                                        fprintf(stderr, " ");
                                }
                        }
                        fprintf(stderr, "), but got (");
                        for (j = 0; j < len; j++) {
                                fprintf(stderr, "0x%x", arr[j]);
-                               if (j != len - 1) {
+                               if (j + 1 < len) {
                                        fprintf(stderr, " ");
                                }
                        }

Reply via email to