Author: ggregory
Date: Wed Nov 28 01:48:45 2012
New Revision: 1414506

URL: http://svn.apache.org/viewvc?rev=1414506&view=rev
Log:
Refactor magic char into NULL_CHAR.

Modified:
    
commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java?rev=1414506&r1=1414505&r2=1414506&view=diff
==============================================================================
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java
 Wed Nov 28 01:48:45 2012
@@ -65,6 +65,8 @@ import org.apache.commons.net.io.SocketI
 
 public class RExecClient extends SocketClient
 {
+    private static final char NULL_CHAR = '\0';
+
     /***
      * The default rexec port.  Set to 512 in BSD Unix.
      ***/
@@ -90,7 +92,7 @@ public class RExecClient extends SocketC
         server = _serverSocketFactory_.createServerSocket(0, 1, 
getLocalAddress());
 
         
_output_.write(Integer.toString(server.getLocalPort()).getBytes("UTF-8")); // 
$NON-NLS-1$
-        _output_.write('\0');
+        _output_.write(NULL_CHAR);
         _output_.flush();
 
         socket = server.accept();
@@ -207,15 +209,15 @@ public class RExecClient extends SocketC
         }
         else
         {
-            _output_.write('\0');
+            _output_.write(NULL_CHAR);
         }
 
         _output_.write(username.getBytes());
-        _output_.write('\0');
+        _output_.write(NULL_CHAR);
         _output_.write(password.getBytes());
-        _output_.write('\0');
+        _output_.write(NULL_CHAR);
         _output_.write(command.getBytes());
-        _output_.write('\0');
+        _output_.write(NULL_CHAR);
         _output_.flush();
 
         ch = _input_.read();


Reply via email to