Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: [Patch] nsock/tests/tests_main.c
From: Henri Doreau <henri.doreau () gmail com>
Date: Tue, 6 Aug 2013 22:06:49 +0200

2013/8/6 Gisle Vanem <gvanem () broadpark no>:
I do like Nmap and will try to contribute. Here is a small fix for now:

--- SVN-Latests/nsock/tests/tests_main.c    2013-06-27 15:25:14 +0000
+++ nsock/tests/tests_main.c 2013-07-11 11:55:05 +0000
@@ -64,7 +64,7 @@
    fflush(stdout);
    rc = test_case_run(current);
    if (rc) {
-      printf(TEST_FAILED " (%s)\n", strerror(-rc));
+      printf(TEST_FAILED " (%s)\n", socket_strerror(-rc));
      break;
    }
    printf(TEST_OK "\n");

----------

Using strerror() for Winsock failures is a big no-no.
Besides, this test program uses ANSI codes to print to the console.
Also a no-no.

--gv
Thanks!

I've committed the socket_strerror() part with a little change
(r31677). Can you elaborate on why ANSI codes should be avoided? I
wouldn't put them everywhere but they're something quite common for
such tests.

Regards

-- 
Henri
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]