Signed-off-by: Steve Ma <[email protected]>
---

 fcoeadm.c |    1 -
 fcoeadm.h |    4 +++-
 fcoemon.c |    8 ++++----
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fcoeadm.c b/fcoeadm.c
index 72cfcbb..35bc434 100644
--- a/fcoeadm.c
+++ b/fcoeadm.c
@@ -23,7 +23,6 @@
 #include <errno.h>
 #include <getopt.h>
 #include <dirent.h>
-#include <string.h>
 #include "fcoeadm.h"
 
 static char *fcoeadm_version = "\
diff --git a/fcoeadm.h b/fcoeadm.h
index bb0bfb4..3064423 100644
--- a/fcoeadm.h
+++ b/fcoeadm.h
@@ -33,7 +33,6 @@
 #include <errno.h>
 #include <unistd.h>
 #include <dirent.h>
-#include <string.h>
 #include <time.h>
 #include <fcntl.h>
 #include <malloc.h>
@@ -49,6 +48,9 @@
 #include "fc_types.h"
 #include "fc_scsi.h"
 
+#define __USE_GNU
+#include <string.h>
+
 #define FCOE_MAX_LUN   255
 
 struct opt_info {
diff --git a/fcoemon.c b/fcoemon.c
index 4037cf0..d08e749 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -192,7 +192,7 @@ fcm_remove_quotes(char *buf, int len)
        char *e = buf + len - 1;
        char tmp[CONFIG_MAX_VAL_LEN + 1];
 
-       if (strnlen(buf, len) < CONFIG_MIN_VAL_LEN)
+       if (len < CONFIG_MIN_VAL_LEN)
                return -1;
        if ((*s >= '0' && *s <= '9') ||
            (*s >= 'a' && *s <= 'z') ||
@@ -339,7 +339,7 @@ fcm_read_config_files(void)
                }
                strncpy(curr->ifname, dp->d_name + 4, sizeof(curr->ifname));
                strncpy(file, CONFIG_DIR "/", sizeof(file));
-               strncat(file, dp->d_name, sizeof(file));
+               strncat(file, dp->d_name, sizeof(file) - strlen(file));
                fp = fopen(file, "r");
                if (!fp) {
                        SA_LOG_ERR(errno, "Failed reading %s\n", file);
@@ -1072,7 +1072,7 @@ dcb_rsp_parser(struct fcm_fcoe *ff, char *rsp, cmd_status 
st)
        int doff;
        int i;
        int n;
-       struct feature_info *f_info;
+       struct feature_info *f_info = NULL;
        char buf[20];
 
        if (st != cmd_success)  /* log msg already issued */
@@ -1380,7 +1380,7 @@ fcm_dcbd_cmd_resp(char *resp, cmd_status st)
        len = strlen(resp);
        ver = fcm_get_hex(resp + DCB_VER_OFF, DCB_VER_LEN, &ep);
        if (ep != NULL) {
-               SA_LOG("parse error: resp %s", resp - 4);
+               SA_LOG("parse error: resp %s", orig_resp);
                return;
        } else if (ver != CLIF_RSP_VERSION) {
                SA_LOG("unexpected version %d resp %s", ver, orig_resp);

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to