Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > f021637f015d9008dd4db490554e61c6 > files > 7

ksh-20060214-1.7.src.rpm

--- ksh-20060214/src/lib/libcmd/uname.c.old	2007-01-12 20:52:27.000000000 +0100
+++ ksh-20060214/src/lib/libcmd/uname.c	2007-01-12 20:55:47.000000000 +0100
@@ -361,6 +361,7 @@
 	else
 	{
 		s = buf;
+		memzero(s, sizeof(buf));
 		if (!flags)
 			flags = OPT_system;
 		memzero(&ut, sizeof(ut));
@@ -372,7 +373,7 @@
 #if !_mem_nodeext_utsname && _lib_gethostname
 			if (sizeof(ut.nodename) > 9 || gethostname(s, sizeof(buf)))
 #endif
-			s = ut.nodename;
+			strncpy(s = buf, ut.nodename, sizeof(buf) - 1);
 			output(OPT_nodename, s, "nodename");
 		}
 		output(OPT_release, ut.release, "release");
@@ -380,20 +381,14 @@
 		output(OPT_machine, ut.machine, "machine");
 		if (flags & OPT_processor)
 		{
-			if (!*(s = astconf("ARCHITECTURE", NiL, NiL)))
-			{
-				if (t = strchr(hosttype, '.'))
-					t++;
-				else
-					t = hosttype;
-				strncpy(s = buf, t, sizeof(buf) - 1);
-			}
+			strncpy(s = buf, ut.machine, sizeof(buf) - 1);
 			output(OPT_processor, s, "processor");
 		}
 		if (flags & OPT_implementation)
 		{
-			if (!*(s = astconf("PLATFORM", NiL, NiL)))
-				s = astconf("HW_NAME", NiL, NiL);
+			strncpy(s = buf, ut.machine, sizeof(buf) - 1);
+			if(strlen(s)==4 && s[0]=='i' && s[2]=='8' && s[3]=='6')
+				s[1]='3';
 			output(OPT_implementation, s, "implementation");
 		}
 		if (flags & OPT_extended_release)