Browse Source

Add strerror to error test

Jeremy Soller 7 years ago
parent
commit
1127c36ceb
1 changed files with 3 additions and 2 deletions
  1. 3 2
      tests/error.c

+ 3 - 2
tests/error.c

@@ -1,8 +1,9 @@
 #include <unistd.h>
 #include <stdio.h>
+#include <string.h>
 #include <errno.h>
 
 int main(int argc, char** argv) {
-    chdir("nonexistent"); 
-    printf("errno: %d\n", errno);
+    chdir("nonexistent");
+    printf("errno: %d = %s\n", errno, strerror(errno));
 }