]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/test-network.c
lua: Add AS object
[people/ms/libloc.git] / src / test-network.c
index 1c49d60658395e5fd10a882f8a41bb9ef4b725f1..717ad3abd92a332bc744f1cb378fcbf904961e07 100644 (file)
@@ -260,13 +260,13 @@ int main(int argc, char** argv) {
 
        FILE* f = tmpfile();
        if (!f) {
-               fprintf(stderr, "Could not open file for writing: %s\n", strerror(errno));
+               fprintf(stderr, "Could not open file for writing: %m\n");
                exit(EXIT_FAILURE);
        }
 
        err = loc_writer_write(writer, f, LOC_DATABASE_VERSION_UNSET);
        if (err) {
-               fprintf(stderr, "Could not write database: %s\n", strerror(-err));
+               fprintf(stderr, "Could not write database: %m\n");
                exit(EXIT_FAILURE);
        }
        loc_writer_unref(writer);
@@ -284,7 +284,7 @@ int main(int argc, char** argv) {
        struct loc_database* db;
        err = loc_database_new(ctx, &db, f);
        if (err) {
-               fprintf(stderr, "Could not open database: %s\n", strerror(-err));
+               fprintf(stderr, "Could not open database: %m\n");
                exit(EXIT_FAILURE);
        }
 
@@ -302,7 +302,6 @@ int main(int argc, char** argv) {
                fprintf(stderr, "Could look up 2001:db8:fffe:1::, but I shouldn't\n");
                exit(EXIT_FAILURE);
        }
-       loc_network_unref(network1);
 
        const struct bit_length_test {
                const char* network;