From b25f9bc8efc3cb8bb0350e28e451d657c186f38c Mon Sep 17 00:00:00 2001 From: dmiller Date: Sat, 1 Sep 2018 18:50:19 +0000 Subject: [PATCH] Use correct ordinals for Nmap's age --- nmap.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nmap.cc b/nmap.cc index 117d3d8fb..d3725d078 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1522,7 +1522,8 @@ void apply_delayed_options() { log_write(LOG_STDOUT | LOG_SKID, "Starting %s %s ( %s ) at %s\n", NMAP_NAME, NMAP_VERSION, NMAP_URL, tbuf); if (o.verbose) { if (local_time->tm_mon == 8 && local_time->tm_mday == 1) { - log_write(LOG_STDOUT | LOG_SKID, "Happy %dth Birthday to Nmap, may it live to be %d!\n", local_time->tm_year - 97, local_time->tm_year + 3); + unsigned int a = (local_time->tm_year - 97)%100; + log_write(LOG_STDOUT | LOG_SKID, "Happy %d%s Birthday to Nmap, may it live to be %d!\n", local_time->tm_year - 97,(a>=11&&a<=13?"th":(a%10==1?"st":(a%10==2?"nd":(a%10==3?"rd":"th")))), local_time->tm_year + 3); } else if (local_time->tm_mon == 11 && local_time->tm_mday == 25) { log_write(LOG_STDOUT | LOG_SKID, "Nmap wishes you a merry Christmas! Specify -sX for Xmas Scan (https://nmap.org/book/man-port-scanning-techniques.html).\n"); }