diff options
author | Simon Josefsson <simon@josefsson.org> | 2005-11-10 02:21:51 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2005-11-10 02:21:51 +0000 |
commit | acc6e4e31e57e8f2d66d94f710a7de1263986b5f (patch) | |
tree | 3f4cef00440cba879c510cbbe66fefb3202dfd69 /gl | |
parent | daa669487e965bb9fef90bbcd1f7f7a1bc951543 (diff) | |
download | gnutls-acc6e4e31e57e8f2d66d94f710a7de1263986b5f.tar.gz |
Update.
Diffstat (limited to 'gl')
-rw-r--r-- | gl/inet_ntop.h | 2 | ||||
-rw-r--r-- | gl/readline.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gl/inet_ntop.h b/gl/inet_ntop.h index de730b15cc..e82f4e0561 100644 --- a/gl/inet_ntop.h +++ b/gl/inet_ntop.h @@ -39,7 +39,7 @@ For more details, see the POSIX:2001 specification <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */ -#ifndef HAVE_DECL_INET_NTOP +#if !HAVE_DECL_INET_NTOP extern const char *inet_ntop (int af, const void *restrict src, char *restrict dst, socklen_t cnt); #endif diff --git a/gl/readline.c b/gl/readline.c index 86dec34110..54405e8458 100644 --- a/gl/readline.c +++ b/gl/readline.c @@ -33,6 +33,7 @@ #include "readline.h" #include <stdio.h> +#include <string.h> #include <getline.h> char * @@ -47,5 +48,10 @@ readline (const char *prompt) if (getline (&out, &size, stdin) < 0) return NULL; + if (out[strlen (out) - 1] == '\r') + out[strlen (out) - 1] = '\0'; + if (out[strlen (out) - 1] == '\n') + out[strlen (out) - 1] = '\0'; + return out; } |