X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/236f657b6dab66f31f4902cecfc03b4673f5bb98:/struct/da-test.c..7cf5c72a6d353ed5a7e340562c11e54c21c85e5e:/struct/t/da-test.c diff --git a/struct/da-test.c b/struct/t/da-test.c similarity index 95% rename from struct/da-test.c rename to struct/t/da-test.c index 38b6055..0f3e625 100644 --- a/struct/da-test.c +++ b/struct/t/da-test.c @@ -104,9 +104,15 @@ int main(void) else printf("%i\n", DA(&v)[i]); } else if (strcmp(p, "first") == 0) { - printf("%i\n", DA_FIRST(&v)); + if (DA_LEN(&v)) + printf("%i\n", DA_FIRST(&v)); + else + puts("*RANGE*"); } else if (strcmp(p, "last") == 0) { - printf("%i\n", DA_LAST(&v)); + if (DA_LEN(&v)) + printf("%i\n", DA_LAST(&v)); + else + puts("*RANGE*"); } else if (strcmp(p, "show") == 0) { if (DA_LEN(&v) == 0) puts("*EMPTY*");