96000d7
diff -up acpitool-0.4.7/src/cpu.cpp.gcc43 acpitool-0.4.7/src/cpu.cpp
96000d7
--- acpitool-0.4.7/src/cpu.cpp.gcc43	2008-01-03 23:49:10.000000000 +0100
96000d7
+++ acpitool-0.4.7/src/cpu.cpp	2008-01-03 23:55:44.000000000 +0100
96000d7
@@ -27,6 +27,8 @@
96000d7
 #include <config.h>
96000d7
 #endif
96000d7
 
96000d7
+#include <cstdlib>
96000d7
+#include <cstring>
96000d7
 #include <iostream>
96000d7
 #include <iomanip>
96000d7
 #include <fstream>
96000d7
@@ -57,7 +59,7 @@ int Show_CPU_Info()
96000d7
 	{
96000d7
 		for(int t=0; t<4; t++) fgets(str, 299, cpuinfo_fp);          // skip 4 lines //
96000d7
 		fgets(str, 299, cpuinfo_fp);
96000d7
-		bzero(temp, 130);				      // use sscanf to extract what we need :  //
96000d7
+		memset(temp, '\0', 130);				      // use sscanf to extract what we need :  //
96000d7
 		sscanf(str, "%*[^:] %*s %[^\n]",temp);                // ignore all up till :,  then ignore the :, then use what's left //
96000d7
 		printf("  CPU type               : %s \n", temp);     // till the newline char //
96000d7
 		fgets(str, 299, cpuinfo_fp);           
96000d7
@@ -67,13 +69,13 @@ int Show_CPU_Info()
96000d7
 		    Show_Freq_Info();          // show freq scaling info if we have it //
96000d7
 		else
96000d7
 		{
96000d7
-		    bzero(temp, 130);           
96000d7
+		    memset(temp, '\0', 130);           
96000d7
 		    sscanf(str, "%*[^:] %*s %s",temp);                    // ignore all up till :,  then ignore the :, then use what's left //
96000d7
 		    printf("  CPU speed              : %s MHz \n", temp);
96000d7
 		}
96000d7
 		
96000d7
 		fgets(str, 299, cpuinfo_fp);
96000d7
-		bzero(temp, 130);
96000d7
+		memset(temp, '\0', 130);
96000d7
 		sscanf(str, "%*[^:] %*s %s",temp);  
96000d7
 		printf("  Cache size             : %s KB\n", temp);
96000d7
 		
96000d7
@@ -82,7 +84,7 @@ int Show_CPU_Info()
96000d7
 		while(!feof(cpuinfo_fp))                      // Run loop until Bogomips line is found //
96000d7
 		{                                             // Need this generic aproach: the bogomips location is //
96000d7
 		    fgets(str, 299, cpuinfo_fp);              // different for Amd64, Opteron, Core Duo, P4 with Ht, ... //
96000d7
-		    bzero(temp, 130);
96000d7
+		    memset(temp, '\0', 130);
96000d7
 		    if(strncmp(str,"bogo",4)==0)
96000d7
 		    {
96000d7
 			sscanf(str, "%*[^:] %*s %s",temp);  
96000d7
@@ -153,23 +155,23 @@ int Show_CPU_Info()
96000d7
 			if(file_in)                   
96000d7
 			{
96000d7
 				file_in.getline(str, 90); // processor id
96000d7
-				bzero(temp, 130);
96000d7
+				memset(temp, '\0', 130);
96000d7
 				strncpy(temp, str+25, 5);
96000d7
 				cout<<"  Processor ID           : "<
96000d7
 
96000d7
 				file_in.getline(str, 100); // acpi id
96000d7
 				file_in.getline(str, 100); // bus mastering control
96000d7
-				bzero(temp, 130);
96000d7
+				memset(temp, '\0', 130);
96000d7
 				strncpy(temp, str+25, 5);
96000d7
 				cout<<"  Bus mastering control  : "<
96000d7
 
96000d7
 				file_in.getline(str, 100); // power management
96000d7
-				bzero(temp, 130);
96000d7
+				memset(temp, '\0', 130);
96000d7
 				strncpy(temp, str+25, 5);
96000d7
 				cout<<"  Power management       : "<
96000d7
 
96000d7
 				file_in.getline(str, 100); // throttling control
96000d7
-				bzero(temp, 130);
96000d7
+				memset(temp, '\0', 130);
96000d7
 				strncpy(temp, str+25, 5);
96000d7
 				cout<<"  Throttling control     : "<
96000d7
 				if(strncmp(temp,"yes",3)==0)
96000d7
@@ -177,7 +179,7 @@ int Show_CPU_Info()
96000d7
 
96000d7
 				file_in.getline(str, 100);	// limit interface (beware: on linux2.4
96000d7
 											// this line yields "perf mgmt")
96000d7
-				bzero(temp, 130);
96000d7
+				memset(temp, '\0', 130);
96000d7
 				strncpy(temp, str+25, 5);
96000d7
 				cout<<"  Limit interface        : "<
96000d7
 
96000d7
@@ -196,7 +198,7 @@ int Show_CPU_Info()
96000d7
 			if(power_fp)                   
96000d7
 			{
96000d7
 				fgets(str, 100, power_fp); // active state
96000d7
-				bzero(temp, 80);
96000d7
+				memset(temp, '\0', 80);
96000d7
 				strncpy(temp, str+25, 5);
96000d7
 				cout<<"  Active C-state         : "<
96000d7
 
96000d7
@@ -268,11 +270,11 @@ int Show_CPU_Info()
96000d7
 				if(throt_fp)                   
96000d7
 				{
96000d7
 				    fgets(str, 100, throt_fp); // active state
96000d7
-				    bzero(temp, 80);
96000d7
+				    memset(temp, '\0', 80);
96000d7
 				    strncpy(temp, str+25, 5);
96000d7
 				    cout<<"  T-state count          : "<
96000d7
 				    fgets(str, 100, throt_fp);
96000d7
-				    bzero(temp, 80);
96000d7
+				    memset(temp, '\0', 80);
96000d7
 				    strncpy(temp, str+25, 5);
96000d7
 				    cout<<"  Active T-state         : "<
96000d7
 				    fclose(throt_fp);
96000d7
diff -up acpitool-0.4.7/src/main.cpp.gcc43 acpitool-0.4.7/src/main.cpp
96000d7
--- acpitool-0.4.7/src/main.cpp.gcc43	2008-01-03 23:49:10.000000000 +0100
96000d7
+++ acpitool-0.4.7/src/main.cpp	2008-01-03 23:56:11.000000000 +0100
96000d7
@@ -27,6 +27,7 @@
96000d7
 #include <config.h>
96000d7
 #endif
96000d7
 
96000d7
+#include <cstdlib>
96000d7
 #include <iostream>
96000d7
 #include <iomanip>
96000d7
 #include <fstream>
96000d7
diff -up acpitool-0.4.7/src/toshiba.cpp.gcc43 acpitool-0.4.7/src/toshiba.cpp
96000d7
--- acpitool-0.4.7/src/toshiba.cpp.gcc43	2008-01-03 23:49:10.000000000 +0100
96000d7
+++ acpitool-0.4.7/src/toshiba.cpp	2008-01-03 23:53:47.000000000 +0100
96000d7
@@ -28,6 +28,7 @@
96000d7
 #include <config.h>
96000d7
 #endif
96000d7
 
96000d7
+#include <cstring>
96000d7
 #include <iostream>
96000d7
 #include <iomanip>
96000d7
 #include <fstream>
96000d7
diff -up acpitool-0.4.7/src/battery.cpp.gcc43 acpitool-0.4.7/src/battery.cpp
96000d7
--- acpitool-0.4.7/src/battery.cpp.gcc43	2008-01-03 23:49:10.000000000 +0100
96000d7
+++ acpitool-0.4.7/src/battery.cpp	2008-01-03 23:58:28.000000000 +0100
96000d7
@@ -27,6 +27,8 @@
96000d7
 #include <config.h>
96000d7
 #endif
96000d7
 
96000d7
+#include <cstdlib>
96000d7
+#include <cstring>
96000d7
 #include <iostream>
96000d7
 #include <iomanip>
96000d7
 #include <fstream>
96000d7
@@ -69,15 +71,15 @@ int Do_Battery_Stuff(int show_empty, int
96000d7
 	    Batt_Info[i] = new Battery_Info;
96000d7
 	    		
96000d7
 	    Batt_Info[i]->Battery_Present = 0;
96000d7
-	    bzero(Batt_Info[i]->Remaining_Cap, 10);
96000d7
-	    bzero(Batt_Info[i]->Design_Cap, 10);
96000d7
-	    bzero(Batt_Info[i]->LastFull_Cap, 10);
96000d7
-	    bzero(Batt_Info[i]->Present_Rate, 10);
96000d7
-	    bzero(Batt_Info[i]->Charging_State, 12);
96000d7
-	    bzero(Batt_Info[i]->Technology, 13);
96000d7
-	    bzero(Batt_Info[i]->Model, 13);
96000d7
-	    bzero(Batt_Info[i]->Serial, 13);
96000d7
-	    bzero(Batt_Info[i]->Bat_Type, 13); 
96000d7
+	    memset(Batt_Info[i]->Remaining_Cap, '\0', 10);
96000d7
+	    memset(Batt_Info[i]->Design_Cap, '\0', 10);
96000d7
+	    memset(Batt_Info[i]->LastFull_Cap, '\0', 10);
96000d7
+	    memset(Batt_Info[i]->Present_Rate, '\0', 10);
96000d7
+	    memset(Batt_Info[i]->Charging_State, '\0', 12);
96000d7
+	    memset(Batt_Info[i]->Technology, '\0', 13);
96000d7
+	    memset(Batt_Info[i]->Model, '\0', 13);
96000d7
+	    memset(Batt_Info[i]->Serial, '\0', 13);
96000d7
+	    memset(Batt_Info[i]->Bat_Type, '\0', 13); 
96000d7
 	    // initialize all struct members to blanks --> avoid rubbish in output //
96000d7
 			
96000d7
 	    Get_Battery_Info(Bat_Nr, Batt_Info[i], verbose);
96000d7
diff -up acpitool-0.4.7/src/thinkpad.cpp.gcc43 acpitool-0.4.7/src/thinkpad.cpp
96000d7
--- acpitool-0.4.7/src/thinkpad.cpp.gcc43	2008-01-03 23:49:10.000000000 +0100
96000d7
+++ acpitool-0.4.7/src/thinkpad.cpp	2008-01-03 23:53:16.000000000 +0100
96000d7
@@ -1,5 +1,7 @@
96000d7
 /* support for IBM Thinkpad acpi driver */
96000d7
 
96000d7
+#include <cstdlib>
96000d7
+#include <cstring>
96000d7
 #include <iomanip>
96000d7
 #include <iostream>
96000d7
 #include <fstream>
96000d7
diff -up acpitool-0.4.7/src/freq.cpp.gcc43 acpitool-0.4.7/src/freq.cpp
96000d7
--- acpitool-0.4.7/src/freq.cpp.gcc43	2008-01-03 23:49:10.000000000 +0100
96000d7
+++ acpitool-0.4.7/src/freq.cpp	2008-01-03 23:57:22.000000000 +0100
96000d7
@@ -27,6 +27,8 @@
96000d7
 #include <config.h>
96000d7
 #endif
96000d7
 
96000d7
+#include <cstdlib>
96000d7
+#include <cstring>
96000d7
 #include <iostream>
96000d7
 #include <iomanip>
96000d7
 #include <fstream>
96000d7
@@ -86,7 +88,7 @@ int Get_Min_Freq()
96000d7
 
96000d7
 	if(freqinfo_fp)                   
96000d7
 	{
96000d7
-		bzero(str, 300);
96000d7
+		memset(str, '\0', 300);
96000d7
 		fscanf(freqinfo_fp, "%s", str);
96000d7
 		min_freq = atoi(str);
96000d7
 		fclose(freqinfo_fp);
96000d7
@@ -110,7 +112,7 @@ int Get_Max_Freq()
96000d7
 
96000d7
 	if(freqinfo_fp)                   
96000d7
 	{
96000d7
-		bzero(str, 300);
96000d7
+		memset(str, '\0', 300);
96000d7
 		fscanf(freqinfo_fp, "%s", str);
96000d7
 		max_freq = atoi(str);
96000d7
 		fclose(freqinfo_fp);
96000d7
@@ -133,7 +135,7 @@ int Get_Current_Freq()
96000d7
 
96000d7
 	if(freqinfo_fp)                   
96000d7
 	{
96000d7
-		bzero(str, 300);
96000d7
+		memset(str, '\0', 300);
96000d7
 		fscanf(freqinfo_fp, "%s", str);
96000d7
 		cur_freq = atoi(str);
96000d7
 		fclose(freqinfo_fp);
96000d7
@@ -155,7 +157,7 @@ int Get_Governor(char *c)
96000d7
 
96000d7
 	if(freqinfo_fp)                   
96000d7
 	{
96000d7
-		bzero(str, 300);
96000d7
+		memset(str, '\0', 300);
96000d7
 		fscanf(freqinfo_fp, "%s", str);
96000d7
 		if (strlen(str)>0)
96000d7
 		    strcpy(c, str);
96000d7
@@ -178,7 +180,7 @@ int Get_Driver(char *c)
96000d7
 
96000d7
 	if(freqinfo_fp)                   
96000d7
 	{
96000d7
-		bzero(str, 300);
96000d7
+		memset(str, '\0', 300);
96000d7
 		fscanf(freqinfo_fp, "%s", str);
96000d7
 		if (strlen(str)>0)
96000d7
 		    strcpy(c, str);
96000d7
diff -up acpitool-0.4.7/src/acpitool.cpp.gcc43 acpitool-0.4.7/src/acpitool.cpp
96000d7
--- acpitool-0.4.7/src/acpitool.cpp.gcc43	2008-01-03 23:49:10.000000000 +0100
96000d7
+++ acpitool-0.4.7/src/acpitool.cpp	2008-01-03 23:52:34.000000000 +0100
96000d7
@@ -28,6 +28,8 @@
96000d7
 #include <config.h>
96000d7
 #endif
96000d7
 
96000d7
+#include <cstring>
96000d7
+#include <cstdlib>
96000d7
 #include <iostream>
96000d7
 #include <iomanip>
96000d7
 #include <fstream>
96000d7
@@ -158,8 +160,8 @@ int Do_SysVersion_Info(int verbose)
96000d7
 {
96000d7
     char Acpi_Version[10], Kernel_Version[15];
96000d7
  
96000d7
-    bzero(Acpi_Version, 10); 
96000d7
-    bzero(Kernel_Version, 15);   
96000d7
+    memset(Acpi_Version, '\0', 10); 
96000d7
+    memset(Kernel_Version, '\0', 15);   
96000d7
 
96000d7
     Get_Kernel_Version(Kernel_Version, verbose);
96000d7
     Get_ACPI_Version(Acpi_Version, verbose);
96000d7
@@ -214,8 +216,8 @@ int Do_Thermal_Info(const int show_trip,
96000d7
     char *name;
96000d7
     char Temperature[5], State[5];
96000d7
  
96000d7
-    bzero(Temperature, 5);     
96000d7
-    bzero(State, 5);
96000d7
+    memset(Temperature, '\0', 5);     
96000d7
+    memset(State, '\0', 5);
96000d7
     
96000d7
     dirname = "/proc/acpi/thermal_zone/";   
96000d7
     thermal_dir = opendir(dirname);
96000d7
@@ -299,7 +301,7 @@ int Do_Thermal_Info(const int show_trip,
96000d7
 		    while(!feof(fp))
96000d7
 		    {
96000d7
 			/* fscanf(fp, "%s", str); */
96000d7
-			bzero(str, 120);
96000d7
+			memset(str, '\0', 120);
96000d7
 			fgets(str, 120, fp);
96000d7
 			if (strlen(str)!=0)  
96000d7
 			  cout<<"  "<
96000d7
@@ -328,7 +330,7 @@ int Do_AC_Info(int verbose)
96000d7
     char *name;
96000d7
     char AC_Status[9];
96000d7
  
96000d7
-    bzero(AC_Status, 9);         // avoid rubbish in output //
96000d7
+    memset(AC_Status, '\0', 9);         // avoid rubbish in output //
96000d7
       
96000d7
     dirname = "/proc/acpi/ac_adapter/";    
96000d7
     ac_dir = opendir(dirname);
96000d7
@@ -402,7 +404,7 @@ int Do_Fan_Info(int verbose)
96000d7
 		return 0;
96000d7
 	}
96000d7
 
96000d7
-	bzero(FAN_Status, 9);         // avoid rubbish in output //
96000d7
+	memset(FAN_Status, '\0', 9);         // avoid rubbish in output //
96000d7
 
96000d7
 	dirname = "/proc/acpi/fan/";    
96000d7
 	fan_dir = opendir(dirname);
96000d7
@@ -531,7 +533,7 @@ int Toggle_WakeUp_Device(const int Devic
96000d7
         file_in.getline(str, 50);
96000d7
         if(strlen(str)!=0)                // avoid empty last line //
96000d7
         {
96000d7
-	    bzero(Name[index], 5);
96000d7
+	    memset(Name[index], '\0', 5);
96000d7
 	    strncpy(Name[index], str, 4);
96000d7
 	    index++;
96000d7
 	}