Repository : ssh://git@open-mesh.org/alfred
On branch : master
commit 24a69ff20ef2530c14f2fd34873d641aad574199 Author: Sven Eckelmann sven@open-mesh.com Date: Tue Jan 8 18:53:13 2013 +0100
alfred: Use isprint to check for printable characters
Signed-off-by: Sven Eckelmann sven@open-mesh.com
24a69ff20ef2530c14f2fd34873d641aad574199 client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/client.c b/client.c index a87dfc2..c7780cb 100644 --- a/client.c +++ b/client.c @@ -28,6 +28,7 @@ #include <arpa/inet.h> #include <sys/select.h> #include <sys/time.h> +#include <ctype.h> #include "alfred.h"
int alfred_client_request_data(struct globals *globals) @@ -84,7 +85,7 @@ int alfred_client_request_data(struct globals *globals) printf("\""); else if (pos[i] == '\') printf("\\"); - else if (pos[i] < 0x20 || pos[i] >= 0x80) + else if (!isprint(pos[i])) printf("\x%02x", pos[i]); else printf("%c", pos[i]);