]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/test-network.c
Replace strerror(errno) with %m in format string throughout
[people/ms/libloc.git] / src / test-network.c
index f27a06ba19c6244e7973823252d305bbcdeb583e..dcb389a6ff3eeb265527221d0b998eadfa7e37e9 100644 (file)
@@ -246,7 +246,7 @@ int main(int argc, char** argv) {
        // Try adding an invalid network
        struct loc_network* network;
        err = loc_writer_add_network(writer, &network, "xxxx:xxxx::/32");
-       if (err != -EINVAL) {
+       if (!err) {
                fprintf(stderr, "It was possible to add an invalid network (err = %d)\n", err);
                exit(EXIT_FAILURE);
        }
@@ -260,7 +260,7 @@ 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);
        }