CAMEL-8116: fix truncation logic

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dd67c384
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dd67c384
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dd67c384

Branch: refs/heads/master
Commit: dd67c384a45b3f57b32a848235cbb17112916f9c
Parents: 112a47f
Author: Daniel Pocock <dan...@pocock.pro>
Authored: Wed Dec 3 16:32:39 2014 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Wed Dec 3 19:34:40 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/smpp/SmppSmCommand.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/dd67c384/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
----------------------------------------------------------------------
diff --git 
a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
 
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
index 83b82c5..e5e53ff 100644
--- 
a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
+++ 
b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java
@@ -48,7 +48,7 @@ public abstract class SmppSmCommand extends 
AbstractSmppCommand {
             case ALLOW:
                 return segments;
             case TRUNCATE:
-                return new byte[][] {segments[0]};
+                return new byte[][] 
{java.util.Arrays.copyOfRange(shortMessage, 0, segments[0].length)};
             case REJECT:
                 // FIXME - JSMPP needs to have an enum of the negative response
                 // codes instead of just using them like this

Reply via email to