Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/iscsi/dist/src/lib Drop pointer checks that are...



details:   https://anonhg.NetBSD.org/src/rev/f59ccd15887d
branches:  trunk
changeset: 333712:f59ccd15887d
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Nov 15 01:15:45 2014 +0000

description:
Drop pointer checks that are always true.

diffstat:

 external/bsd/iscsi/dist/src/lib/parameters.c |  7 +------
 external/bsd/iscsi/dist/src/lib/target.c     |  3 +--
 2 files changed, 2 insertions(+), 8 deletions(-)

diffs (30 lines):

diff -r 738dd09be84e -r f59ccd15887d external/bsd/iscsi/dist/src/lib/parameters.c
--- a/external/bsd/iscsi/dist/src/lib/parameters.c      Fri Nov 14 23:45:02 2014 +0000
+++ b/external/bsd/iscsi/dist/src/lib/parameters.c      Sat Nov 15 01:15:45 2014 +0000
@@ -919,12 +919,7 @@
                if (strcmp(value, "?") == 0) {
                        iscsi_trace(TRACE_ISCSI_PARAM, "got inquiry for param \"%s\"\n", param->key);
                        if (param->value_l) {
-                               if (param->value_l->value) {
-                                       (void) strlcpy(param->answer_tx, param->value_l->value, sizeof(param->answer_tx));
-                               } else {
-                                       iscsi_err(__FILE__, __LINE__, "param \"%s\" has NULL value_l->value\n", param->key);
-                                       param->answer_tx[0] = 0x0;
-                               }
+                               (void) strlcpy(param->answer_tx, param->value_l->value, sizeof(param->answer_tx));
                        } else {
                                iscsi_err(__FILE__, __LINE__, "param \"%s\" has NULL value_l\n", param->key);
                                param->answer_tx[0] = 0x0;
diff -r 738dd09be84e -r f59ccd15887d external/bsd/iscsi/dist/src/lib/target.c
--- a/external/bsd/iscsi/dist/src/lib/target.c  Fri Nov 14 23:45:02 2014 +0000
+++ b/external/bsd/iscsi/dist/src/lib/target.c  Sat Nov 15 01:15:45 2014 +0000
@@ -762,8 +762,7 @@
                        return -1;
                }
                if (ptr->rx_offer) {
-                       if (ptr->offer_rx &&
-                           strcmp(ptr->offer_rx, "All") == 0 &&
+                       if (strcmp(ptr->offer_rx, "All") == 0 &&
                            !param_equiv(sess->params, "SessionType",
                                "Discovery")) {
                                iscsi_trace(TRACE_ISCSI_DEBUG,



Home | Main Index | Thread Index | Old Index