From c5371dbd3bf60eb9ea2239dc2af009b61bdf933b Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 5 Sep 2014 17:52:08 +0200 Subject: astraceroute: Don't duplicate copyright/bug report/license string Move the copyright/bug report/license string to an own constant and use it for the output of help() and version() to avoid duplication and prevent the strings from getting out of sync. This makes the text section of astraceroute.o slightly smaller: before: text data bss dec hex filename 18481 0 4 18485 4835 astraceroute/astraceroute.o after: text data bss dec hex filename 18201 0 4 18205 471d astraceroute/astraceroute.o Signed-off-by: Tobias Klauser --- astraceroute.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/astraceroute.c b/astraceroute.c index 6b2ffc5..cef668a 100644 --- a/astraceroute.c +++ b/astraceroute.c @@ -117,6 +117,13 @@ static const struct option long_options[] = { {NULL, 0, NULL, 0} }; +static const char *copyright = "Please report bugs to \n" + "Copyright (C) 2011-2013 Daniel Borkmann \n" + "Swiss federal institute of technology (ETH Zurich)\n" + "License: GNU GPL version 2.0\n" + "This is free software: you are free to change and redistribute it.\n" + "There is NO WARRANTY, to the extent permitted by law.\n"; + static const struct sock_filter ipv4_icmp_type_11[] = { { 0x28, 0, 0, 0x0000000c }, /* ldh [12] */ { 0x15, 0, 8, 0x00000800 }, /* jneq #0x800, drop */ @@ -226,13 +233,8 @@ static void __noreturn help(void) " If the TCP probe did not give any results, then astraceroute will\n" " automatically probe for classic ICMP packets! To gather more\n" " information about astraceroute's fetched AS numbers, see e.g.\n" - " http://bgp.he.net/AS!\n\n" - "Please report bugs to \n" - "Copyright (C) 2011-2013 Daniel Borkmann \n" - "Swiss federal institute of technology (ETH Zurich)\n" - "License: GNU GPL version 2.0\n" - "This is free software: you are free to change and redistribute it.\n" - "There is NO WARRANTY, to the extent permitted by law.\n"); + " http://bgp.he.net/AS!\n\n"); + puts(copyright); die(); } @@ -240,13 +242,8 @@ static void __noreturn version(void) { printf("\nastraceroute %s, Git id: %s\n", VERSION_LONG, GITVERSION); puts("autonomous system trace route utility\n" - "http://www.netsniff-ng.org\n\n" - "Please report bugs to \n" - "Copyright (C) 2011-2013 Daniel Borkmann \n" - "Swiss federal institute of technology (ETH Zurich)\n" - "License: GNU GPL version 2.0\n" - "This is free software: you are free to change and redistribute it.\n" - "There is NO WARRANTY, to the extent permitted by law.\n"); + "http://www.netsniff-ng.org\n\n"); + puts(copyright); die(); } -- cgit v1.2.3-54-g00ecf