]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
9.9 doesn't have isc_buffer_reserve
authorMark Andrews <marka@isc.org>
Tue, 18 Aug 2015 09:41:35 +0000 (19:41 +1000)
committerMark Andrews <marka@isc.org>
Tue, 18 Aug 2015 11:22:14 +0000 (21:22 +1000)
bin/tests/wire_test.c

index 49416ab3c01704be673ab957f3a1720b98d67acc..3303c166c845c0e01bf0a6147502869ae8e632c3 100644 (file)
@@ -113,7 +113,6 @@ main(int argc, char *argv[]) {
        isc_boolean_t need_close = ISC_FALSE;
        isc_boolean_t tcp = ISC_FALSE;
        isc_boolean_t rawdata = ISC_FALSE;
-       isc_result_t result;
        isc_uint8_t c;
        FILE *f;
        int ch;
@@ -189,8 +188,7 @@ main(int argc, char *argv[]) {
 
        if (rawdata) {
                while (fread(&c, 1, 1, f) != 0) {
-                       result = isc_buffer_reserve(&input, 1);
-                       RUNTIME_CHECK(result == ISC_R_SUCCESS);
+                       RUNTIME_CHECK(isc_buffer_availablelength(input) > 0);
                        isc_buffer_putuint8(input, (isc_uint8_t) c);
                }
        } else {
@@ -223,8 +221,7 @@ main(int argc, char *argv[]) {
                                c = fromhex(*rp++);
                                c *= 16;
                                c += fromhex(*rp++);
-                               result = isc_buffer_reserve(&input, 1);
-                               RUNTIME_CHECK(result == ISC_R_SUCCESS);
+                               RUNTIME_CHECK(isc_buffer_availablelength(input) > 0);
                                isc_buffer_putuint8(input, (isc_uint8_t) c);
                        }
                }