]> git.ipfire.org Git - location/libloc.git/blobdiff - src/test-country.c
Don't abuse errno as return code
[location/libloc.git] / src / test-country.c
index e4edea0dabde149dac674dc559d5b9e041721dc0..9820e8b0f187ce0d38df2ea082da4c2c39032879 100644 (file)
@@ -130,7 +130,7 @@ int main(int argc, char** argv) {
 
        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);
@@ -139,7 +139,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);
        }