[PATCH openpower-host-ipmi-oem v3 7/7] Fixed string pointer usage

OpenBMC Patches patches at stwcx.xyz
Sat Oct 17 07:29:41 AEDT 2015


From: Chris Austen <austenc at us.ibm.com>

---
 oemhandler.C | 7 ++-----
 testit.C     | 8 +++-----
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/oemhandler.C b/oemhandler.C
index 427831c..0cc7099 100644
--- a/oemhandler.C
+++ b/oemhandler.C
@@ -11,9 +11,6 @@ uint16_t g_record_id = 0x0100;
 
 #define LSMSSWAP(x,y) ((y)<<8|(x))
 
-const char *fio_wb = "wb";
-const char *fio_rb = "rb+";
-
 
 ///////////////////////////////////////////////////////////////////////////////
 // For the First partial add eSEL the SEL Record ID and offset 
@@ -61,9 +58,9 @@ ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
     // to indicate this is a new record rather then an ofset in
     // my next commit TODO
     if (offset == 0) {
-        pio = fio_wb;
+        pio = "wb";
     } else {
-        pio = fio_rb;
+        pio = "rb+";
     }
 
     if ((fp = fopen(string, pio)) != NULL) {
diff --git a/testit.C b/testit.C
index 25e069c..2b0005e 100644
--- a/testit.C
+++ b/testit.C
@@ -1,12 +1,10 @@
-#include <iostream>
 #include <cstdlib>
-#include "ipmid-api.h"
-#include "oemhandler.h"
 #include <cstring>
-
-#include <iostream>
 #include <fstream>
+#include <iostream>
 #include <vector>
+#include "ipmid-api.h"
+#include "oemhandler.h"
 
 using namespace std;
 
-- 
2.6.0




More information about the openbmc mailing list