This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix alpha gethostname and sunrpc


Hi!

2 little fixes.

2001-09-04  Jakub Jelinek  <jakub@redhat.com>

	* sunrpc/rpc_cout.c (upcase): Account for trailing '\0'.
	* sysdeps/unix/sysv/linux/alpha/gethostname.c: Include <errno.h>.
	(__syscall_gethostname): Add prototype.

--- libc/sunrpc/rpc_cout.c.jj	Mon Mar 26 10:02:29 2001
+++ libc/sunrpc/rpc_cout.c	Tue Sep  4 13:32:44 2001
@@ -801,7 +801,7 @@ static char *
 upcase (const char *str)
 {
   char *ptr, *hptr;
-  ptr = malloc (strlen (str));
+  ptr = malloc (strlen (str) + 1);
   if (ptr == NULL)
     {
       f_print (stderr, "malloc failed\n");
--- libc/sysdeps/unix/sysv/linux/alpha/gethostname.c.jj	Mon Sep  3 19:10:56 2001
+++ libc/sysdeps/unix/sysv/linux/alpha/gethostname.c	Tue Sep  4 13:33:23 2001
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -24,6 +25,7 @@
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
+extern int __syscall_gethostname (char *name, size_t len);
 
 int
 __gethostname (char *name, size_t len)

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]