Date: Friday, December 1, 2006 @ 15:07:42
  Author: gilles
    Path: /cvsroot/carob/carob/src

Modified: ControllerInfo.cpp (1.3 -> 1.4)

Made string compairison safer by using strncmp


--------------------+
 ControllerInfo.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: carob/src/ControllerInfo.cpp
diff -u carob/src/ControllerInfo.cpp:1.3 carob/src/ControllerInfo.cpp:1.4
--- carob/src/ControllerInfo.cpp:1.3    Wed Nov 29 20:29:37 2006
+++ carob/src/ControllerInfo.cpp        Fri Dec  1 15:07:42 2006
@@ -250,7 +250,7 @@
 
 bool ControllerInfo::operator ==(const ControllerInfo& ci) const
 {
-  int cmp = strcmp(hostname, ci.hostname);
+  int cmp = strncmp(hostname, ci.hostname, NI_MAXHOST);
   if (cmp == 0) // same name, compare ports
   {
     return host_port == ci.host_port;
@@ -261,7 +261,7 @@
 
 bool ControllerInfo::operator <(const ControllerInfo& ci) const
 {
-  int cmp = strcmp(hostname, ci.hostname);
+  int cmp = strncmp(hostname, ci.hostname, NI_MAXHOST);
   if (cmp == 0) // same name, compare ports
   {
     return host_port < ci.host_port;
@@ -272,7 +272,7 @@
 
 bool ControllerInfo::operator >(const ControllerInfo& ci) const
 {
-  int cmp = strcmp(hostname, ci.hostname);
+  int cmp = strncmp(hostname, ci.hostname, NI_MAXHOST);
   if (cmp == 0) // same name, compare ports
   {
     return host_port > ci.host_port;

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to