From ba2d3fccbd565c9f5f8f652fcc300672e7bf09be Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 18 Aug 2012 18:28:26 +0200 Subject: [PATCH] Move adu_isspace() to interactive.c. This macro is only used there, so it need not be public. --- adu.h | 15 --------------- interactive.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/adu.h b/adu.h index 83c3c66..42b9471 100644 --- a/adu.h +++ b/adu.h @@ -85,21 +85,6 @@ #endif /** \endcond */ -/** - * Wrapper for isspace. - * NetBSD needs this. - */ -/* - * The values should be cast to an unsigned char first, then to int. - * Why? Because the isdigit (as do all other is/to functions/macros) - * expect a number from 0 upto and including 255 as their (int) argument. - * Because char is signed on most systems, casting it to int immediately - * gives the functions an argument between -128 and 127 (inclusive), - * which they will use as an array index, and which will thus fail - * horribly for characters which have their most significant bit set. - */ -#define adu_isspace(c) isspace((int)(unsigned char)(c)) - /** * Write a log message to a dynamically allocated string. * diff --git a/interactive.c b/interactive.c index 8f94076..7aef9e2 100644 --- a/interactive.c +++ b/interactive.c @@ -129,6 +129,21 @@ static int icom_set(char *line) return parse_select_options(line, ¶ms, &admissible_uids, &fi); } +/** + * Wrapper for isspace. + * NetBSD needs this. + */ +/* + * The values should be cast to an unsigned char first, then to int. + * Why? Because the isdigit (as do all other is/to functions/macros) + * expect a number from 0 upto and including 255 as their (int) argument. + * Because char is signed on most systems, casting it to int immediately + * gives the functions an argument between -128 and 127 (inclusive), + * which they will use as an array index, and which will thus fail + * horribly for characters which have their most significant bit set. + */ +#define adu_isspace(c) isspace((int)(unsigned char)(c)) + static int exec_interactive_command(char *line) { const char const *delim = "\t\n\f\r\v "; -- 2.39.5