From 640460deb5caec133af023ef65ea352cb53eaec4 Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 6 Sep 2012 20:36:35 +0000 Subject: [PATCH] Fixed problems reported by Greg King. git-svn-id: svn://svn.cc65.org/cc65/trunk@5819 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- testcode/lib/dir-test.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/testcode/lib/dir-test.c b/testcode/lib/dir-test.c index 479caa335..93fdcb7c4 100644 --- a/testcode/lib/dir-test.c +++ b/testcode/lib/dir-test.c @@ -27,14 +27,8 @@ int main(void) { char* name = "."; unsigned char go = 0; - register DIR *D; - struct dirent* E; - - D = opendir (name); - if (D == 0) { - printf("error opening %s: %s\n", name, strerror (errno)); - return 1; - } + DIR *D; + register struct dirent* E; /* Explain usage and wait for a key */ printf ("Use the following keys:\n" @@ -86,7 +80,7 @@ done: if (errno == 0) { printf ("Done\n"); } else { - printf("Done: %d (s)\n", errno, strerror (errno)); + printf("Done: %d (%s)\n", errno, strerror (errno)); } /* Close the directory */